Updating ExpandableListView with notifyDataSetChanged()

前端 未结 3 2045
庸人自扰
庸人自扰 2020-12-20 14:49

First a short overview of my code, i hope its understandable:

  • I have a class called ToDoElement with a few variables.
  • I
3条回答
  •  被撕碎了的回忆
    2020-12-20 15:11

    You need to add a DeleteMethod of some sort to the Adapter and remove the item from the Adapter manually, not only remove it from the List.

    Each time you refresh the the views using notifyDataSetChanged() the Adapter will call the loop around the List. Your List in the Adapter gets a null value due to the changes you made.

提交回复
热议问题