Clear Android ListView

后端 未结 4 852
别那么骄傲
别那么骄傲 2021-01-22 10:39

I have a ListView. I want to dynamically change the contents of the listview.I used \"adapter.notifyDataSetChanged();\" to change the contents. I have also tried setting the ada

4条回答
  •  借酒劲吻你
    2021-01-22 11:26

    If you use an ArrayAdapter instead of a SimpleAdapter you can call

    ArrayAdapter.clear();
    ArrayAdapter.notifyDataSetChanged();
    

    To remove all the elements from the adapter.

提交回复
热议问题