For direct scrolling:
getListView().setSelection(11);
For smooth scrolling:
getListView().smoothScrollToPosition(11);
Scroll up
getListView().setSelectionAfterHeaderView();
Note
try to call it in the message, because once the listview has not yet been created, when you call it with the method
getListView().postDelayed(new Runnable() { @Override public void run() { lst.setSelection(15); } },100L);
Nepster May 13 '15 at 7:12 2015-05-13 07:12
source share