How can I go to a list item in Android?

I have an application in which I have one editor. And also I have one list that is filled with 100 items and can only display 5 items at a time. I enter the number (n) in the Edittext, and I want the listview to move to the nth element of the list and that the nth element should be at the top of the viewport (the one that displays 5 elements of the list). Could you tell me how this can be achieved.

+6
android listview
source share
1 answer

Calling setSelection (position) should do the trick.

+10
source share

All Articles