There is a scrollView in which the view gradually added, you need to make it so that when you add a new view , it scrolls to the bottom. To do this, I use the following code, but the scrolling takes place exactly to the penultimate element, and not the last.

 scrollView.fullScroll(ScrollView.FOCUS_DOWN); 

scroll_view.xml

  <ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <LinearLayout android:orientation="vertical" android:id="@+id/linearLayout" android:layout_width="match_parent" android:layout_height="match_parent"> </LinearLayout> </ScrollView> 

    1 answer 1

    I just did this for myself =)

     private void scrollDialogDown() { mainScrollView.post(new Runnable() { @Override public void run() { mainScrollView.fullScroll(ScrollView.FOCUS_DOWN); } }); } 
    • great, it works. - Kirill Stoianov