How/where in the code to detect wether in ListFragment's ListView all items are visible?
问题 I am trying to change the ActionBar's action depending on wether all list items are visible (there's less items that fit to the screen => show "Add item" action | there are some items invisible => show "Search" action) What method of ListFragment should I override in order to be able to use getListView().getLastVisiblePosition() and get not -1? This is the code from my ListFragment, but in onCreateOptionsMenu lv.getLastVisiblePosition() always returns -1. @Override public void