Android examples for android.media:Media Uri
get Real Path From URI for Media Store
import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore; public class Main { public static String getRealPathFromURI(Uri contentUri, Activity activity) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = activity.managedQuery(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst();/*from w w w . j a v a 2s.co m*/ return cursor.getString(column_index); } public static String getString(Context context, final int mStringId) { return context.getResources().getString(mStringId); } }