views:

136

answers:

1

Hey all,

I have an ArrayAdapter powering a ListView. I would like to change the data behind the ArrayAdapter and update the ListView's. Sounds like notifyDataSetChanged(); would be exactly what I am looking for, but it updates the entire ListView, and I would prefer to update on a row-by-row basis.

Is there a way to do this with ArrayAdapter, or do I need to manage my data some other way if I want this functionality?

+3  A: 

It doesn't work like that, as far as I know.

It will only redraw the visible rows. This happens when you're scrolling anyway. If you're scrolling down, and one of your rows (a View) goes off the top, Android reuses it if possible when drawing rows that come into view from the bottom. This is what the 3rd parameter (convertView) of ListAdapter.getView() is for.

I'm pretty sure Android only draws the rows that you're able to see in any case.

synic
Verified that it does indeed work this way. Thanks
Hamy