I’m developing an application on Android 3.2/4.0.3 for both phones and tablets. I have been using the Fragments functionality and on the left fragment I have extended the ListFragment and successfully added my own custom view to each list row (layout defined in its own XML file). My issue arises occasionally when scrolling, for some reason the list goes crazy and rows overlap and bounce around within the list. Has anyone come across this behaviour before?
I have attached some examples below. I have searched around trying to find examples of this happening, but I can’t find any. There doesn’t seem to be a bug report raised for it either, so I don’t know if it’s due to the way I’ve written the code or this is a “feature” of Android.
Any help would be much appreciated.
List Fragment working correctly – https://i.stack.imgur.com/cG2yN.png
Crazy List Fragment behaviour – https://i.stack.imgur.com/gDbm9.png
I’m not sure about this function:
Why are you returning p_convertView if it’s not null? Android is probably spazzing out and using original views rather than creating new ones? Try this…