Code example for ListFragment

Methods: isResumed, setListShown, setListShownNoAnimation

0
        @Override public void onLoadFinished(Loader<List<AppEntry>> loader, List<AppEntry> data) {
            // Set the new data in the adapter. 
            mAdapter.setData(data);
 
            // The list should now be shown. 
            if (isResumed()) {
                setListShown(true);
            } else { 
                setListShownNoAnimation(true);
            } 
        } 
 
        @Override public void onLoaderReset(Loader<List<AppEntry>> loader) {
            // Clear the data in the adapter. 
            mAdapter.setData(null);
        } 
    } 
}