Highlight selected item in “ListFragment”?

前端 未结 7 775
情歌与酒
情歌与酒 2020-12-16 02:35

I have posted the same problem a couple of times but it hasn\'t yet been resolved. I have a ListFragment and I want to highlight the selected item in the list.

7条回答
  •  眼角桃花
    2020-12-16 03:36

    From your ListView, call setChoiceMode(ListView.CHOICE_MODE_SINGLE). Then, whenever you want to highlight a selected item, call setItemChecked(index, true).

提交回复
热议问题