Android ListView setSelection() does not seem to work

前端 未结 17 1767
情歌与酒
情歌与酒 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条回答
  •  误落风尘
    2020-11-28 07:13

    Simply try this code

      listView.setAdapter(adapter);
      listView.setSelection(position);
      adapter.notifyDataSetChanged(); 
    

提交回复
热议问题