Android examples for android.media:Media Uri
get Path for media Uri via Activity
import android.app.Activity; import android.database.Cursor; import android.media.ExifInterface; import android.net.Uri; import android.provider.MediaStore; import java.io.IOException; 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);/*from w w w . j a va2 s.c o m*/ activity.startManagingCursor(cursor); int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } }