How to scroll to bottom in a ScrollView on activity startup


I am displaying some data in a ScrollView. On activity startup (method onCreate) I fill the ScrollView with data and want to scroll to the bottom.

I tried to use getScrollView().fullScroll(ScrollView.FOCUS_DOWN). This works when I make it as an action on button click but it doesn't work in the onCreate method.

Is there any way how to scroll the ScrollView to the bottom on activity startup? That means the view is already scrolled to the bottom when first time displayed.

7/22/2010 9:03:54 AM

Accepted Answer

It needs to be done as following:

    getScrollView().post(new Runnable() {

        public void run() {

This way the view is first updated and then scrolls to the "new" bottom.

7/22/2010 3:07:23 PM

Put the following code after your data is added:

final ScrollView scrollview = ((ScrollView) findViewById(; Runnable() {
    public void run() {

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow