Android smoothScrollBy behaving badly

sometimes it will be because of the timing issue. When the views are added to your listview and the time you do

view.smoothScrollBy(distance, time);

the listview or the ui still need not get refreshed. So do this in the views post thread with a specific delay. Eg.

view.postDelayed(new Runnable{
    view.smoothScrollBy(distance, time);
},1000);

Try some of these:

Listview has its own scrolling mechanism. It scrolls when the content is added.

  1. Assign listview height (android:layout_height) to match_parent or fill_parent.

  2. If your assigning a adapter in a working thread. Do not perform any UI actions in the thread.

If these do not solve the issue. Please post the code where you assign the adapter to the list view if any. Or the relevant code.

Also the xml layout code.

Hope this helps.