开发者

How can I jump to an item of a list view in android?

开发者 https://www.devze.com 2023-02-15 20:01 出处:网络
I have an application where I have one edittext. And also I have one listview that is populated with 100 items and can show only 5 items at a time. I enter a number (n) in th开发者_JAVA百科e Edittext

I have an application where I have one edittext. And also I have one listview that is populated with 100 items and can show only 5 items at a time. I enter a number (n) in th开发者_JAVA百科e Edittext and I want listview to jump to the n th item of the list view and that n th item should come at the top of the viewable area (the one that shows 5 listview items). Can you please tell me how this can be achieved..


A call to setSelection(position) should do the trick.

0

精彩评论

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