Android - Add item to custom listview on button click

后端 未结 2 538
暗喜
暗喜 2021-01-20 00:57

I currently have a custom listview where each item on the list contains two rows of text. What I would like to do is each time a user clicks on the button, it creates a new

2条回答
  •  天涯浪人
    2021-01-20 01:30

    After calling fillData(), just make a call on adapter.notifyDataSetChanged().

    NotifyDataSetChanged() - Notifies the attached View that the underlying data has been changed and it should refresh itself.

提交回复
热议问题