mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +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();
|
failureToast.show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
private String getRealPathFromURI(Uri contentURI) {
|
private String getRealPathFromURI(Uri contentURI) {
|
||||||
String result;
|
String result;
|
||||||
Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
|
Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
|
||||||
|
|
@ -180,6 +180,15 @@ public class ShareActivity
|
||||||
}
|
}
|
||||||
return result;
|
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
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue