Reputation: 27295
I have a ListView. The number of rows is typically more than a single screen, but still not very large. The rows sometimes contain custom controls like CheckBoxes and EditText fields. I have found that reloading the rows leads to all sorts of annoying behavior. For example, an EditText does not like having its instance swapped out when it is open. This can happen if the ListView is reloaded.
I am curious if anyone has tried custom caching in this type of situation. Basically, just cache a view for every row, and ignore Android's convertView. Alternatively, tell Android that each row has a separate type for recycling purposes. Would either of those be likely to produce good results?
Upvotes: 0
Views: 36
Reputation: 111
Using getViewTypeCount and getItemViewType is the best way to handle multiple view types in a list view. Check the accepted answer from this post: Android ListView with different layouts for each row for additional information.
Upvotes: 1