Code example for ListFragment

Methods: getListView, onStop

0
        setUserVisibleHint(true);
    } 
 
    @Override 
    public void onStop() { 
        firstVisiblePosition= getListView().getFirstVisiblePosition();
        super.onStop(); 
    } 
 
 
    @Override 
    public void onViewStateRestored(Bundle savedInstanceState) {
        super.onViewStateRestored(savedInstanceState);
 
        if((savedInstanceState != null) && (getListView() != null))
            getListView().setSelection(savedInstanceState.getInt("listPosition"));
    } 
 
 
    @Override 
    public void onResume() {