0

I want to scroll a page using the following code. I am not getting where i am wrong. I am using this piece of code

scroll = (ScrollView)findViewById(R.id.scroll);
    scroll.post(new Runnable() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            scroll.fullScroll(ScrollView.FOCUS_DOWN);

        }
    });



when i run this code it is not scrolling

1 Answers1

0

Try this

scroll.post(new Runnable() {
                            @Override
                            public void run() {
                                /*
                                 * Scrolling to bottom every time when new
                                 * element is created
                                 */
                                scroll.fullScroll(View.FOCUS_DOWN);
                            }
                        });

I hope this will help you.

Kristiyan Varbanov
  • 2,439
  • 2
  • 17
  • 37
  • i want to scroll down automatically on run time. – Vikas Singh Feb 26 '15 at 05:20
  • plz help me out on auto scroll down in this code its not working – Vikas Singh Feb 26 '15 at 13:10
  • did you see this links http://stackoverflow.com/questions/3080402/android-scrollview-force-to-bottom , http://stackoverflow.com/questions/5224761/android-scrollview-autoscrolling-as-text-is-added , http://stackoverflow.com/questions/3307267/how-to-scroll-to-bottom-in-a-scrollview-on-activity-startup they may help you to :) – Kristiyan Varbanov Feb 26 '15 at 13:42
  • after using PostDelayed it scroll but scroll vry fast and go to the bottom of the list. i want to scroll slowly and continuously. plz help me out on that. i want to make a notice board type which is scrolling continuously and smothly. – Vikas Singh Feb 27 '15 at 06:52