Scrolling to bottom of an Android scrollable view

ScrollToday I found the need to automatically scroll to the bottom of an Android scrollable view through Java. In case you need to do the same, here is how:

Get your scrollable layout:

scrollView01 = (ScrollView) findViewById(R.id.ScrollView01);
ScrollView scrollView01;

Scroll down when certain action is taken…

scrollView01.fullScroll(ScrollView.FOCUS_DOWN);

In my case, I am making a sub-layout view visible when a button is clicked. But, I want the users to see the results right away. This allows me to immediately show the users the results.

Leave a Reply