Java tutorial
//package com.java2s; //License from project: Open Source License import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore.MediaColumns; public class Main { public static Uri getMediaUri(Cursor cursor, Uri uri) { String id = cursor.getString(cursor.getColumnIndex(MediaColumns._ID)); return Uri.withAppendedPath(uri, id); } }