Java tutorial
//package com.java2s; import android.content.Context; import android.content.res.AssetFileDescriptor; import android.net.Uri; import android.provider.ContactsContract; import java.io.IOException; import java.io.InputStream; public class Main { private static InputStream openDisplayPhoto(final Context context, final Uri contactUri) { Uri displayPhotoUri = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO); try { AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); return fd.createInputStream(); } catch (IOException e) { return null; } } }