How to refresh dynamic listview?
I have 开发者_JAVA技巧a dynamic listview and I want to refresh the list when any new item is added. How can I do this.Pls help me.
Thanks, Monali
Call notifyDataSetChanged() on your adapter
Here is a demo for how u can do that http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/
USE setListAdapter(yourAdapter);
Make your adapter to ListAdapter find more details here
then just use
yourAdapter.notifyDataSetChanged();
and you are done !
1) create a method
2) set adapterView in that method.
3) at click event of any image button call that method.
or to put Adapter.notifyDataSetChanged();
I think this would be easy for you.
Also you can do this like... I have custom row for list. It has textview and I can change it's value ...
((TextView)(myWatchList.getChildAt(INDEX - myWatchList.getFirstVisiblePosition()).findViewById(R.id.symbolCountTV))).setText(NEWSTRING);
精彩评论