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

前端 未结 13 1026
甜味超标
甜味超标 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:44

    Create an onItemClickListener then use this snippet, filling in the appropriate values:

    listView.performItemClick(View view, int position, long id);
    

    See the docs for further detail.

提交回复
热议问题