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

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

    You can call listview.setSelection(0);. Just make sure you are calling this after poplulating your List. If you call it before populating your List it will not work, because it won't have any data at that time.

    0 讨论(0)
提交回复
热议问题