public static String getFilePathFromUri(Uri uri, Context c) {
try {
String filePath = null;
String scheme = uri.getScheme();
if (scheme != null && scheme.equals("content")) {
ContentResolver contentResolver = c.getContentResolver();
Cursor cursor = contentResolver.query(uri, null, null, null,
null);
cursor.moveToFirst();
filePath = cursor.getString(cursor
.getColumnIndexOrThrow(Images.Media.DATA));
}
return filePath;
} catch (Exception e) {
//java.lang.illegalArgumentException: column'_data' does not exist
return null;
}
}
I get this Exception When the Image is from Picasa folder.