Android ListView Move to cursor position

I have a ListView that is controlled by a standard BaseAdapter.

When the user clicks the button, I want the ListView to scroll to view the 100th record.

How it's done?

+3
source share
1 answer

Try this feature

public void setSelection (int position)

Since: API Level 1 Sets the currently selected item. If in touch mode the item is not selected, but it will still be positioned properly. If the indicated selection position is less than 0, then the position at position 0. parameters (starting from 0) the data item to be selected.

So myListView.setSelection(99);

+6
source

Source: https://habr.com/ru/post/1759003/


All Articles