Bialy Bialy - 9 months ago 16
Android Question

Scrolling a ScrollView to a specific id

I have a Scrollview in my activity , I want when I press a button the view scrolls down to a specific ID in the view. After some search here I found I can use this code Runnable() {
public void run() {

but it scrolls all the page down. I want to scroll to a specific ID in the middle of the view

ScrollView scrollView = (ScrollView) findViewById(;
scrollView.postDelayed(new Runnable() {
     public void run() {
          scrollView.scrollTo(0, (int)view.getY());
}, 100);

view = your view you want to scroll to