I have an activity that when users press "share" on a file it would open my app and start uploading the file. Now this works perfectly with images because the URI returned is for MediaStore. But I want to be able to return the URI from any source such as from ES File Explorer
Here is the current code:
public String getPath(Uri uri) {
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
How can I make this so instead of MediaStore it will be used for any type of file?