I have in my activity a listview and an imagebutton. When I click the imagebutton I want to go to a specific position in the list (I do this by calling: setSelection(int positio
I have write simple method to stop scoll ListView using reflection.
private void stopScroll(AbsListView view)
{
try
{
Field field = android.widget.AbsListView.class.getDeclaredField("mFlingRunnable");
field.setAccessible(true);
Object flingRunnable = field.get(view);
if (flingRunnable != null)
{
Method method = Class.forName("android.widget.AbsListView$FlingRunnable").getDeclaredMethod("endFling");
method.setAccessible(true);
method.invoke(flingRunnable);
}
}
catch (Exception e) {}
}
Just call stopScroll(myListView); when you need to stop scroll.