How To Call Notifydatasetchanged() On Arraylist View?
This is the ArrayList page that opens as a result page after update and save. I guess I would need to somehow refresh so that it reflects the changes on the UI. I've tried to call
Solution 1:
You need to create an adapter for your ListView. The adapter is what feeds data to it for displaying. I would recommend you reading through this tutorial:
http://www.vogella.com/articles/AndroidListView/article.html
So once you have created your adapter and then called lv.setAdapter(<adapter>)
, you can then call <adapter>.notifyDataSetChanged()
. This will tell the adapter that it needs to refresh itself.
Solution 2:
You can use notifyDataSetChanged() method for your adapter.Wherever you want to update your listview you can use in following manner.
adapter.notifyDataSetChanged();
Post a Comment for "How To Call Notifydatasetchanged() On Arraylist View?"