Reputation: 604
So as the title says , i have this problem with my listview . Im not using any ordinary listview , im using the observable scrollview library which is based on a listview .
Firstly, i would like to clarify a few things to give you guys more clarity.
I didn't have this problem until i changed a couple of things with my listview's custom adapters layout.
This seems wierd because i didn't get this problem before .
It scrolls at an abnormal rate , i just fling and it hits the bottom suddenly.
scrolling slowly doesn't cause the problem
Should i slow down my listview and try , if so how ?
I load more items on scroll , i have a footerview too and the footerview stays only a second or less .
Upvotes: 1
Views: 1024
Reputation: 2443
This can also be caused by a bug in Android 5.1. The bug report can be found here. Two fast up swipes on a ListView cause it to hit the top of the list and then instantly scroll to the bottom.
Currently the only solution appears to be using a ScrollView instead of a ListView.
Upvotes: 3
Reputation: 12328
In your getView
method, you have
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.custom, parent, false);
Replace with
if (convertView == null) {
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.custom, parent, false);
}
And, it will be much better.
Btw, ViewHolder is not so hard. If this does not work, you have to implement ViewHolder correctly. Also avoid doing too much stuff in getView
and make sure you load images asynchronously ( most imageLoader libraries will do this for you )
Upvotes: 0