How to force a ListView to rebuild/repaint itself

by n179911 » Thu, 17 Sep 2009 08:13:11 GMT


Sponsored Links
 Hi,

Is there anyway to force ListView to rebuild/repaint itself?
i.e. re-get item from the ListAdapter (it can be a CursorAdapter or
ArrayAdapter) and then repaint the all the list view which are
visible?

Thank you.

--~--~---------~--~----~------------~-------~--~----~



How to force a ListView to rebuild/repaint itself

by Mark Murphy » Thu, 17 Sep 2009 08:18:45 GMT


 


For ArrayAdapter, modify the contents of the list through the adapter
itself (e.g., call add() on the ArrayAdapter), and it will automatically
update the UI.

For CursorAdapter, requery() the underlying Cursor, and it will
automatically update the UI.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 In Print!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Clip Image

Actually i am developing an app for Droid,my app  detects the face of
a person.But i want that detected part to be clipped for further
processing,can any one post a sample code to clip the detected part.

-- 
.

2. BPP in Android planned?

Hi,

does anybody plan to implement Bluetooth Printing Profile (BPP) in
Android (2.x or 3.x)? I'm not sure about the smartphones, but for
tablets it would make sense for sure.

If not, what API would you suggest as free or paid software (commercial use)?

Thank you in advance.

-- 
.

3. Views inside a custom ViewGroup not rendering after a size change

4. Bls: Need Help..DHD kerendam air

5. Access Androidify avatar from another app

6. converting Java jar to Android App

7. Force Close on Click in Calendar after i delete all information set in it