开发者

What is the best way to get the item selected in the listview?

开发者 https://www.devze.com 2023-01-05 01:03 出处:网络
I have a listview which has a bunch of selections. I want to keep the focus on the listview in touchmode and get the item selected. What is the best way to do that?

I have a listview which has a bunch of selections. I want to keep the focus on the listview in touchmode and get the item selected. What is the best way to do that?

I found this blog: http://bestsiteinthemultiverse.com/2009/12/android-selected-state-listview-example/

and http://developer.android.com/resou开发者_开发百科rces/articles/touch-mode.html

What does the community suggest?


You can't keep focus in touch mode. You can use the "choice mode" instead to keep items checked.


To get an idea of how to use ListView I'd take a look at this Google I/O video. It helped me a lot in getting going and goes over the choice mode (I think).

http://code.google.com/events/io/2010/sessions/world-of-listview-android.html

0

精彩评论

暂无评论...
验证码 换一张
取 消