Android examples for android.media:Media Uri
get Path from Uri in MediaStore
import android.app.Activity; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore; public class Main { public static String getPath(Activity activity, Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = activity.managedQuery(uri, projection, null, null, null); activity.startManagingCursor(cursor); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst();/* w w w. j a v a2 s . c om*/ return cursor.getString(column_index); } }