mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Tidying up code
This commit is contained in:
parent
5dcfd0964d
commit
87ad638b56
1 changed files with 1 additions and 25 deletions
|
|
@ -166,25 +166,6 @@ public class ShareActivity
|
|||
finish();
|
||||
}
|
||||
|
||||
|
||||
private String getRealPathFromURI(Uri contentUri) {
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
cursor = getContentResolver().query(contentUri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
return cursor.getString(column_index);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
return "";
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
@ -213,10 +194,9 @@ public class ShareActivity
|
|||
Log.d(TAG, "Ext storage dir: " + Environment.getExternalStorageDirectory());
|
||||
|
||||
//convert image Uri to file path
|
||||
String filePath = getRealPathFromURI(mediaUri);
|
||||
String filePath = FileUtils.getPath(this, mediaUri);
|
||||
Log.d(TAG, "Filepath: " + filePath);
|
||||
|
||||
|
||||
if (filePath != null && !filePath.equals("")) {
|
||||
//extract the coordinates of image in decimal degrees
|
||||
Log.d(TAG, "Calling GPSExtractor");
|
||||
|
|
@ -247,16 +227,12 @@ public class ShareActivity
|
|||
Log.d(TAG, "Cache found, setting categoryList in MwVolleyApi to " + displayCatList.toString());
|
||||
MwVolleyApi.setGpsCat(displayCatList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(savedInstanceState != null) {
|
||||
contribution = savedInstanceState.getParcelable("contribution");
|
||||
}
|
||||
|
||||
requestAuthToken();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue