Android notifyDataSetChanged not working

江枫思渺然 提交于 2019-12-02 07:08:26

create a method in your adapter like:

 public void updateList(){
   notifyDataSetChanged() 
 }

and call this method when you want to refresh the list

Call notifyDataSetChanged() method from your Adapter class (in getView() method) which extends BaseAdapter after deleting item.

First of all you have to make changes in map (Data source of the adapter). And use Handler class(Android OS Thread) to run the thread like this

    Handler handler=new Handler();
    handler.post(run);

you can not create object of list.

just create reference and asign list to your list

remove this statement in you adapter class

mData = new ArrayList();

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!