Refresh an listView after insert on database
I want to refresh the listView after an insert or delete in the database.. I search and i found notifyDataSetChanged () but i don't know how to use it..
Someone can explain how to do this? Even by开发者_高级运维 a different way..
When the delete button is clicked do the following:
- Delete the corresponding list item from the database.
- Get an new cursor for your list by executing the query which fills the list again.
- Bind the new cursor to the list using changeCurosr().
- Call notifyDataSetChanged() on the adapter.
精彩评论