Android examples for User Interface:ListView
scroll ListView To Position
import android.annotation.TargetApi; import android.os.Build; import android.view.View; import android.widget.ListView; public class Main{ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static void scrollToPosition(ListView messageListView, int position, int y) { scrollToPosition(messageListView, position, y, null); }//from w w w . j a va2 s.c o m @TargetApi(Build.VERSION_CODES.HONEYCOMB) private static void scrollToPosition(final ListView messageListView, final int position, final int y, final ScrollToPositionListener listener) { messageListView.post(new Runnable() { @Override public void run() { messageListView.setSelectionFromTop(position, y); if (listener != null) { listener.onScrollEnd(); } } }); } }