Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore.Images.Media; public class Main { public static String getAbsoluteImagePath(Context context, Uri uri) { // can post image String[] proj = { Media.DATA }; Cursor cursor = context.getContentResolver().query(uri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(Media.DATA); cursor.moveToFirst(); String path = cursor.getString(column_index); cursor.close(); return path; } }