ListView not “refreshing” after item is deleted from it

后端 未结 6 1782
半阙折子戏
半阙折子戏 2021-01-28 16:27

I am trying to figure out how I \"Refresh\" the list view the user is on when an item from my listview is deleted. I have tried notifyDataSetChanged() but to no avail, which is

6条回答
  •  不要未来只要你来
    2021-01-28 17:28

    after removing items always add the below two lines

                notifyDataSetChanged();
                notifyDataSetInvalidated();
    

    notifydatasetchanged will see for any changes in the list and notifydatasetinvalidated will check if there is any item removed then it will update the list

提交回复
热议问题