mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fixes cursor bug
This commit is contained in:
parent
2bdfdcb79e
commit
116288f2fa
1 changed files with 10 additions and 1 deletions
|
|
@ -166,7 +166,7 @@ public class ShareActivity
|
|||
failureToast.show();
|
||||
finish();
|
||||
}
|
||||
|
||||
/**
|
||||
private String getRealPathFromURI(Uri contentURI) {
|
||||
String result;
|
||||
Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
|
||||
|
|
@ -180,6 +180,15 @@ public class ShareActivity
|
|||
}
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
private String getRealPathFromURI(Uri contentUri) {
|
||||
String[] proj = { MediaStore.Images.Media.DATA };
|
||||
Cursor cursor = getContentResolver().query(contentUri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
return cursor.getString(column_index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue