How do I delete an item from my custom base adapter?

后端 未结 5 1661
半阙折子戏
半阙折子戏 2020-12-16 22:29

I am extending BaseAdapter to make a custom listview row. I have context menu that opens everytime a user holds on the row and prompts if he wants to delete it. However how

5条回答
  •  囚心锁ツ
    2020-12-16 23:00

    To delete, you'll need to do 2 things:

    1. Call .remove() on your ArrayList (items).
    2. Call .notifyDataSetChanged() on the instance of your MyListAdapter class (mListAdapter).

提交回复
热议问题