public static final class

ContactsContract.Contacts.Photo

extends Object
implements BaseColumns ContactsContract.DataColumns
java.lang.Object
   ↳ android.provider.ContactsContract.Contacts.Photo

Class Overview

A read-only sub-directory of a single contact that contains the contact's primary photo.

Usage example:

 public InputStream openPhoto(long contactId) {
     Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
     Uri photoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.CONTENT_DIRECTORY);
     Cursor cursor = getContentResolver().query(photoUri,
          new String[] {Contacts.Photo.PHOTO}, null, null, null);
     if (cursor == null) {
         return null;
     }
     try {
         if (cursor.moveToFirst()) {
             byte[] data = cursor.getBlob(0);
             if (data != null) {
                 return new ByteArrayInputStream(data);
             }
         }
     } finally {
         cursor.close();
     }
     return null;
 }
 

You should also consider using the convenience method openContactPhotoInputStream(ContentResolver, Uri)

Summary

Constants
String CONTENT_DIRECTORY The directory twig for this sub-table
[Expand]
Inherited Constants
From interface android.provider.BaseColumns
From interface android.provider.ContactsContract.DataColumns
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CONTENT_DIRECTORY

Since: API Level 5

The directory twig for this sub-table

Constant Value: "photo"