Home » Android » android – ListView set first visible position

android – ListView set first visible position

Posted by: admin June 15, 2020 Leave a comment

Questions:

In ListView I can get index of the first item displayed by using getFirstVisiblePosition()
How can I set an item at a particular index to display in the first position – I want something like setFirstVisiblePosition( int index )

How to&Answers:

You can use setSelection(index) so the display will jump to the index you want.