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. Using <Uses-Library> in android application

Hi,

Can any one explain how i can use the "Uses-Library" tag in Android
manifest file as i am facing problem in using it. Following is the
exact senario what i am doing.

1. Having an external jar file. name it as sample.jar
2. Created one Android application which uses the jar in it. (Added
<Uses-Library android:name="sample" /> line in manifest file)
3. Copied the "sample.jar" file to system/framework folder in the
device.
4. Trying to install the Android application in the device. Error:
"Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY"

Anything is missing here?

Regards,
Reddy

-- 

2. Android Contact Search

Scenario:

i am working on a code to get the contact phone number by search the
name. I have name of the contact and i want to get the number from the
contact list. Will some help me ???

Any Code will be a great help of mine...

Thanks

-- 

3. CLosed WTB: pulsa XL murmer

4. DONT FORGIVE - DONT FORGET - 26/11 - 2 Years But Nothing Different

5. PUBLISHED APPS MISSING FROM UPDATED CONSOLE

6. Test Framework available in Andorid Native Layer

7. Android Market Console Pagination