Code example for ListFragment

Methods: getActivity, getListView, getView

0
    } 
 
 
    /** {@inheritDoc} */ 
    public void onQueryComplete(int token, Object cookie, Cursor cursor) {
        if (getActivity() == null) {
            return; 
        } 
 
        if (token == ProbeDataViewQuery._TOKEN) {
            onProbesQueryComplete(cursor);
        } else { 
            cursor.close();
        } 
    } 
 
    /** 
     * Handle {@link VendorsQuery} {@link Cursor}. 
     */ 
    private void onProbesQueryComplete(Cursor cursor) {
        if (mCursor != null) {
            // In case cancelOperation() doesn't work and we end up with consecutive calls to this 
            // callback. 
            getActivity().stopManagingCursor(mCursor);
            mCursor = null;
        } 
 
        // TODO(romannurik): stopManagingCursor on detach (throughout app) 
        mCursor = cursor;
        getActivity().startManagingCursor(mCursor);
        mAdapter.changeCursor(mCursor);
        if (mCheckedPosition >= 0 && getView() != null) {
            getListView().setItemChecked(mCheckedPosition, true);
        } 
    } 
 
    @Override 
    public void onResume() {