Code example for ListFragment

Methods: getListView, getActivity, getView

0
		} 
	} 
 
	/** {@inheritDoc} */ 
	public void onQueryComplete(int token, Object cookie, Cursor cursor) {
		if (getActivity() == null) {
			return; 
		} 
 
		if (token == TRAILS_TOKEN || token == SEARCH_TOKEN) {
			onTrailOrSearchQueryComplete(cursor);
		} else if (token == AREA_TOKEN) {
			onAreaQueryComplete(cursor);
		} else { 
			Log.d("SessionsFragment/onQueryComplete",
					"Query complete, Not Actionable: " + token);
			cursor.close();
		} 
	} 
 
	/** 
	 * Handle {@link TrailsQuery} {@link Cursor}. 
	 */ 
	private void onTrailOrSearchQueryComplete(Cursor cursor) {
		mCursor = cursor;
		getActivity().startManagingCursor(mCursor);
		mAdapter.changeCursor(mCursor);
		if (mCheckedPosition >= 0 && getView() != null) {
			getListView().setItemChecked(mCheckedPosition, true);
		} 
	} 
 
	/** 
	 * Handle {@link AreasQuery} {@link Cursor}.