List view row Selection
i have a simple list view control 开发者_Go百科my queries are:
1) how to set first row selected on start (after fill data in list view)
2) when i navigate by hardware button i got AdapterView.OnItemSelectedListener and color of row background change, but when i click i not get any OnItemSelectedListener and no row selected. How to select row on click.
3) when i change focus list row selection removed,
please any one with any solution, code example or articles i search but no susses
with regards Chandra Kant Singh
how to set first row selected on start (after fill data in list view)
Call setSelection()
on the ListView
. However, this only will have a visual effect if the user entered your activity via the pointing device (trackball, D-pad, etc.).
How to select row on click.
You don't.
when i change focus list row selection removed,
If I understand what you mean by "change focus", this is working as designed.
Please review this article on touch mode and the use of the "selected" state, then adjust your UI design to follow Android conventions. Selection is only used when the user navigates with the pointing device, not when the user uses the touch screen.
精彩评论