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.aengbee.android.leanback.ui.SearchFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { String query = mQuery;//from w w w . ja va2 s. c o m Loader<Cursor> c; if (query.contains(" ")) { c = new CursorLoader(getActivity(), VideoContract.VideoEntry.CONTENT_URI, null, // Projection to return - null means return all fields. //VideoContract.VideoEntry.COLUMN_CATEGORY + " = ? AND " + " ( lower ( trim ( " + VideoContract.VideoEntry.COLUMN_NAME + " , ? ) ) LIKE ? OR " + " lower ( trim ( " + VideoContract.VideoEntry.COLUMN_DESC + " , ? ) ) LIKE ? OR " + " lower ( trim ( " + VideoContract.VideoEntry.COLUMN_NAME + " , ? ) ) LIKE ? OR " + " lower ( trim ( " + VideoContract.VideoEntry.COLUMN_DESC + " , ? ) ) LIKE ? ) AND " + VideoContract.VideoEntry.COLUMN_RATING_SCORE + " == ? ", // Selection clause is category. new String[] { SPECIAL_CHARACTERS, "%" + query + "%", SPECIAL_CHARACTERS, "%" + query + "%", SPECIAL_CHARACTERS, queryNormalizer(query), SPECIAL_CHARACTERS, queryNormalizer(query), "1" }, VideoContract.VideoEntry.COLUMN_NAME// Default sort order ); } else { c = new CursorLoader(getActivity(), VideoContract.VideoEntry.CONTENT_URI, null, // Projection to return - null means return all fields. //VideoContract.VideoEntry.COLUMN_CATEGORY + " = ? AND " + " ( lower ( trim ( " + VideoContract.VideoEntry.COLUMN_NAME + " , ? ) ) LIKE ? OR " + " lower ( trim ( " + VideoContract.VideoEntry.COLUMN_DESC + " , ? ) ) LIKE ? ) AND " + VideoContract.VideoEntry.COLUMN_RATING_SCORE + " == ? ", // Selection clause is category. new String[] { SPECIAL_CHARACTERS, "%" + query + "%", SPECIAL_CHARACTERS, "%" + query + "%", "1" }, VideoContract.VideoEntry.COLUMN_NAME// Default sort order ); } return c; }
From source file:de.hshannover.f4.trust.ironcontrol.view.list_activities.ListSavedPublishsActivity.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { String[] projection = { Requests.COLUMN_ID, Requests.COLUMN_METADATA, Requests.COLUMN_IDENTIFIER1, Requests.COLUMN_IDENTIFIER1_Value, Requests.COLUMN_IDENTIFIER2, Requests.COLUMN_IDENTIFIER2_Value, Requests.COLUMN_NAME, Requests.COLUMN_LIFE_TIME }; CursorLoader cursorLoader = new CursorLoader(this, DBContentProvider.PUBLISH_URI, projection, null, null, null);// ww w. j av a2 s . c o m return cursorLoader; }
From source file:io.github.protino.codewatch.ui.LeaderboardFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { return new CursorLoader(context, LeaderContract.LeaderEntry.CONTENT_URI, Constants.LEADER_COLUMNS, null, null, Constants.LEADER_SORT_ORDER); }
From source file:net.callmeike.android.mojowire.ui.PodcastFragment.java
@Override public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { return new CursorLoader(getActivity(), PodcastContract.Podcasts.URI, PROJ, null, null, PodcastContract.Podcasts.Columns.TITLE + " ASC"); }
From source file:com.android.dialer.filterednumber.BlockedNumbersFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { final String[] projection = { FilteredNumberContract.FilteredNumberColumns._ID, FilteredNumberContract.FilteredNumberColumns.COUNTRY_ISO, FilteredNumberContract.FilteredNumberColumns.NUMBER, FilteredNumberContract.FilteredNumberColumns.NORMALIZED_NUMBER }; final String selection = FilteredNumberContract.FilteredNumberColumns.TYPE + "=" + FilteredNumberContract.FilteredNumberTypes.BLOCKED_NUMBER; return new CursorLoader(getContext(), FilteredNumberContract.FilteredNumber.CONTENT_URI, projection, selection, null, null);//from w w w . ja va 2s. com }
From source file:com.example.isse.weatherapp.ui.WeatherListActivity.java
@Override public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { return new CursorLoader(this, WeatherContract.WeatherEntry.CONTENT_URI, null, null, null, null); }
From source file:org.alfresco.mobile.android.application.fragments.operations.OperationWaitingDialogFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { Uri baseUri = BatchOperationContentProvider.CONTENT_URI; if (parent != null) { return new CursorLoader(getActivity(), baseUri, BatchOperationSchema.COLUMN_ALL, BatchOperationSchema.COLUMN_PARENT_ID + "=\"" + parent.getIdentifier() + "\" AND " + BatchOperationSchema.COLUMN_REQUEST_TYPE + "=" + operationType, null, null);/* ww w .jav a2 s. c o m*/ } else { return new CursorLoader(getActivity(), baseUri, BatchOperationSchema.COLUMN_ALL, BatchOperationSchema.COLUMN_REQUEST_TYPE + "=" + operationType, null, null); } }
From source file:fr.tvbarthel.apps.sayitfromthesky.activities.MainActivity.java
/** * Create a {@link android.support.v4.content.Loader} for the drawings. * * @return a Loader<Cursor>//w w w .j av a 2 s . com */ private Loader<Cursor> createDrawingLoader() { return new CursorLoader(this, DrawingContract.CONTENT_URI, null, null, null, DrawingContract.Columns.COLUMN_CREATION_TIME + " DESC"); }
From source file:com.xengar.android.englishverbs.ui.EditorActivity.java
@Override public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { // Since the editor shows all verb attributes, define a projection that contains // all columns from the verb table String[] projection = ActivityUtils.allVerbColumns(); return new CursorLoader(this, // Parent activity context VerbEntry.CONTENT_URI, projection, // Columns to include in the resulting Cursor COLUMN_ID + " = ?", // selection clause new String[] { Long.toString(verbID) }, // selection arguments null); // Default sort order }
From source file:com.sintef_energy.ubisolar.fragments.UsageFragment.java
@Override public Loader<Cursor> onCreateLoader(int mode, Bundle bundle) { return new CursorLoader(getActivity(), EnergyContract.Devices.CONTENT_URI, EnergyContract.Devices.PROJECTION_ALL, null, null, DeviceModel.DeviceEntry._ID + " ASC"); }