Android ListView setSelection() does not seem to work

前端 未结 17 1763
情歌与酒
情歌与酒 2020-11-28 06:45

I have a ListActivity that implements onListItemClick() and calls a doSomething() function of the class. The latter contains l.s

17条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 06:54

    Found a solution in my case. I am not using a Runnable since my class is extending ListFragment. What I had to do is make my index a final; final index = 5; mListView.setSelection(index);

提交回复
热议问题