I'm not able to read data part from the selected image Uri, this happens on some specific device Lg nexus 5 api 6.0.1
Uri of a selected image
content://com.google.android.apps.photos.contentprovider/-1/1/content://media/external/images/media/200/ORIGINAL/NONE/2077196451
Code used to get data from the uri
public static String getDataColumn(Context context, Uri uri, String selection,
String[] selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = {
column
};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
null);
if (cursor != null && cursor.moveToFirst()) {
final int index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(index);
}
}catch (Exception e){
e.printStackTrace();
}
finally {
if (cursor != null)
cursor.close();
}
return null;
}
Not issue with the permissions handling, Required Permissions are given.