How to select item in the list view programmatically

后端 未结 2 1646
温柔的废话
温柔的废话 2021-01-28 06:29

I have an ArrayList List which contains some items from the listview all_list. How can I select these items in the list view all_list programmatically

2条回答
  •  独厮守ぢ
    2021-01-28 07:22

    set an onItemClickListener to the listview such that on click, you set a boolean flag that sets the checkbox in each row to selected. then call notifyDataSetChanged()

提交回复
热议问题