Android examples for android.media:Media Uri
convert Media Uri To Path
import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore; public class Main{ public static String convertMediaUriToPath(Context context, Uri uri) { Cursor cursor = null;//from ww w . java 2 s . com try { String[] fields = { MediaStore.Images.Media.DATA }; cursor = context.getContentResolver().query(uri, fields, null, null, null); int column_index = cursor.getColumnIndex(fields[0]); if (column_index >= 0) { cursor.moveToFirst(); return cursor.getString(column_index); } } catch (Exception ignore) { } finally { cursor.close(); } return null; } }