Code example for ListFragment

Methods: getListView, isAdded

0
    @Override 
    public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
        mCursor = cursor;
        mStreamAdapter.changeCursor(mCursor);
        mStreamAdapter.notifyDataSetChanged();
        if (mListViewStatePosition != -1 && isAdded()) {
            getListView().setSelectionFromTop(mListViewStatePosition, mListViewStateTop);
            mListViewStatePosition = -1;
        } 
    } 
 
    @Override 
    public void onLoaderReset(Loader<Cursor> loader) {
    } 
 
    private class StreamAdapter extends CursorAdapter {
        private JsonFactory mFactory = new AndroidJsonFactory();
        private Map<Long, Activity> mActivityCache = new HashMap<Long, Activity>();
 
        public StreamAdapter(Context context) {
            super(context, null, 0);