I tried to get the image bitmap for a URI but it is giving me the following error.
System.err(3102): java.io.FileNotFoundException: No content provider: /storage/emulated/0/1.jpg
The code i tried is,
Cursor mCursor;
mCursor=activity.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,mProjection,null, null, MediaStore.Images.Media.DEFAULT_SORT_ORDER);
if (mCursor != null) {
mCursor.moveToFirst();
do {
String strPath = mCursor.getString(mCursor
.getColumnIndex(MediaStore.Images.Media.DATA));
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(
activity.getContentResolver(), Uri.parse(strPath));
//Here i'm using bitmap
} catch (FileNotFoundException e) {
Log.i("Exception",
"Image file not found: " + e.getMessage());
e.printStackTrace();
} catch (IOException e) {
Log.i("Exception",
"Input Output Failure: " + e.getMessage());
e.printStackTrace();
}
} while (mCursor.moveToNext());