views:

1639

answers:

2

i want to know how to refresh the ListActivity when i change/add data to the list wich is dispayed.

i first thougt the ListAdapter would know when the list is changed but when i add elements to the list there is no update, only when i close the activity and reopen it i see the changes. so i searched for any update() refesh() or something like that method but there is none. so it seem i didnt get the concept, can someone help me please?

+4  A: 

If you are using an ArrayAdapter, manipulate the contents of the list through the adapter -- do not touch the underlying list. There are add(), insert(), and remove() methods on ArrayAdapter.

If you are using a CursorAdapter, run a requery() on the Cursor.

CommonsWare
ok thanks no i understand how it works
Sponge
+4  A: 

Try ArrayAdapter:notifyDataSetChanged
Google docs link

bhatt4982