public void scrollDown() { scroll.postDelayed( new Runnable() { @Override public void run() { scroll.fullScroll(View.FOCUS_DOWN); } }, 250); }
/** * Sets the currently selected item. * * @param position */ public void setSelection(final int position) { if (mAdapter == null || mAdapter.getCount() < 1) { throw new NullPointerException("Currently no items!"); } if (position < 0 || position >= mAdapter.getCount()) { throw new IllegalArgumentException("Position out of index"); } if (mContentScrollView.getHeight() == 0) { mContentScrollView.postDelayed( new Runnable() { @Override public void run() { setNextSelectedPositionInt(position); } }, 1); } else { setNextSelectedPositionInt(position); } }