void (boolean directionForward) { int listSize = myShowingResultsList.getItemsCount(); if (listSize > 0) { int indexToSelect = directionForward ? listSize - 1 : 0; myShowingResultsList.setSelectedIndex(indexToSelect); myShowingResultsList.ensureIndexIsVisible(indexToSelect); } launchSearchingFurther(directionForward); }