How to make the first item of a ListView to be selected as default at startup?

前端 未结 13 1041
甜味超标
甜味超标 2020-12-11 16:08

There is a ListView in my App and the ListView has a selector. I want to make the first item of this ListView to be selected as default at the very

13条回答
  •  误落风尘
    2020-12-11 16:33

    You can do this by

    yourListView.setSelection(0);
    yourListView.getSelectedView().setSelected(true);
    

    I hope this will help you

提交回复
热议问题