use of android.support.v4.content.CursorLoader in project apps-android-wikipedia by wikimedia.
the class RecentSearchesFragment method onCreateLoader.
@Override
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
Uri uri = SearchHistoryContract.Query.URI;
final String[] projection = null;
final String selection = null;
final String[] selectionArgs = null;
String order = SearchHistoryContract.Query.ORDER_MRU;
return new CursorLoader(getContext(), uri, projection, selection, selectionArgs, order);
}
use of android.support.v4.content.CursorLoader in project YhLibraryForAndroid by android-coco.
the class AgentWebUtils method getRealPathBelowVersion.
private static String getRealPathBelowVersion(Context context, Uri uri) {
String filePath = null;
String[] projection = { MediaStore.Images.Media.DATA };
CursorLoader loader = new CursorLoader(context, uri, projection, null, null, null);
Cursor cursor = loader.loadInBackground();
if (cursor != null) {
cursor.moveToFirst();
filePath = cursor.getString(cursor.getColumnIndex(projection[0]));
cursor.close();
}
return filePath;
}
Aggregations