Skip to content

Instantly share code, notes, and snippets.

@BlaShadow
Created February 28, 2014 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlaShadow/9270495 to your computer and use it in GitHub Desktop.
Save BlaShadow/9270495 to your computer and use it in GitHub Desktop.
Get Path from uri Java
public String getPath(Uri uriFile){
String[] proj = { MediaStore.Images.Media.DATA };
CursorLoader loader = new CursorLoader(this, uriFile, proj, null, null, null);
Cursor cursor = loader.loadInBackground();
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment