ListView scroll to selected item

I have a ListView with an edit text and a button below it. When I click on a listView item the keyboard appears and push up the edit text and the button. I want the list to scroll to the selected item. Any idea? Thanks


Solution 1:

You can use ListView's setSelection(int position) method to scroll to a row.

Solution 2:

You could use ListView's smoothScrollToPosition(int position) to scroll to a particular location in the list.