List of usage examples for android.content CursorLoader CursorLoader
public CursorLoader(Context context, Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder)
From source file:com.google.samples.apps.iosched.ui.CurrentSessionActivity.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle data) { CursorLoader loader = null;// w w w. j av a 2 s.c o m if (id == SessionsQuery._TOKEN) { loader = new CursorLoader(this, mSessionUri, SessionsQuery.PROJECTION, null, null, null); } else if (id == SpeakersQuery._TOKEN && mSessionUri != null) { Uri speakersUri = ScheduleContract.Sessions.buildSpeakersDirUri(mSessionId); loader = new CursorLoader(this, speakersUri, SpeakersQuery.PROJECTION, null, null, ScheduleContract.Speakers.DEFAULT_SORT); } else if (id == FeedbackQuery._TOKEN) { Uri feedbackUri = ScheduleContract.Feedback.buildFeedbackUri(mSessionId); loader = new CursorLoader(this, feedbackUri, FeedbackQuery.PROJECTION, null, null, null); } else if (id == TAG_METADATA_TOKEN) { loader = TagMetadata.createCursorLoader(this); } return loader; }
From source file:com.google.samples.apps.iosched.ui.SessionDetailFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle data) { CursorLoader loader = null;//from w w w . j a va2 s . c om if (id == SessionsQuery._TOKEN) { loader = new CursorLoader(getActivity(), mSessionUri, SessionsQuery.PROJECTION, null, null, null); } else if (id == SpeakersQuery._TOKEN && mSessionUri != null) { Uri speakersUri = ScheduleContract.Sessions.buildSpeakersDirUri(mSessionId); loader = new CursorLoader(getActivity(), speakersUri, SpeakersQuery.PROJECTION, null, null, ScheduleContract.Speakers.DEFAULT_SORT); } else if (id == FeedbackQuery._TOKEN) { Uri feedbackUri = ScheduleContract.Feedback.buildFeedbackUri(mSessionId); loader = new CursorLoader(getActivity(), feedbackUri, FeedbackQuery.PROJECTION, null, null, null); } else if (id == TAG_METADATA_TOKEN) { loader = TagMetadata.createCursorLoader(getActivity()); } return loader; }
From source file:com.android.mail.compose.ComposeActivity.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { switch (id) { case INIT_DRAFT_USING_REFERENCE_MESSAGE: return new CursorLoader(this, mRefMessageUri, UIProvider.MESSAGE_PROJECTION, null, null, null); case REFERENCE_MESSAGE_LOADER: return new CursorLoader(this, mRefMessageUri, UIProvider.MESSAGE_PROJECTION, null, null, null); case LOADER_ACCOUNT_CURSOR: return new CursorLoader(this, MailAppProvider.getAccountsUri(), UIProvider.ACCOUNTS_PROJECTION, null, null, null);//from ww w. ja v a2 s . c om } return null; }
From source file:com.android.mms.ui.ComposeMessageActivity.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { if (id == LOAD_TEMPLATE_BY_ID) { long rowID = args.getLong("id"); Uri uri = ContentUris.withAppendedId(Template.CONTENT_URI, rowID); return new CursorLoader(this, uri, null, null, null, null); } else {//w ww. j av a2 s. c o m return new CursorLoader(this, Template.CONTENT_URI, null, null, null, null); } }