Skip to content

Most visited

Recently visited

navigation

ContactsContract.DisplayPhoto

public static final class ContactsContract.DisplayPhoto
extends Object

java.lang.Object
   ↳ android.provider.ContactsContract.DisplayPhoto


Helper class for accessing full-size photos by photo file ID.

Usage example:

Retrieving a full-size photo by photo file ID (see PHOTO_FILE_ID)
 public InputStream openDisplayPhoto(long photoFileId) {
     Uri displayPhotoUri = ContentUris.withAppendedId(DisplayPhoto.CONTENT_URI, photoKey);
     try {
         AssetFileDescriptor fd = getContentResolver().openAssetFileDescriptor(
             displayPhotoUri, "r");
         return fd.createInputStream();
     } catch (IOException e) {
         return null;
     }
 }
 

Summary

Constants

String DISPLAY_MAX_DIM

Queries to CONTENT_MAX_DIMENSIONS_URI will contain this column, populated with the maximum height and width (in pixels) that will be stored for a display photo.

String THUMBNAIL_MAX_DIM

Queries to CONTENT_MAX_DIMENSIONS_URI will contain this column, populated with the height and width (in pixels) for photo thumbnails.

Fields

public static final Uri CONTENT_MAX_DIMENSIONS_URI

This URI allows the caller to query for the maximum dimensions of a display photo or thumbnail.

public static final Uri CONTENT_URI

The content:// style URI for this class, which allows access to full-size photos, given a key.

Inherited methods

From class java.lang.Object

Constants

DISPLAY_MAX_DIM

added in API level 14
String DISPLAY_MAX_DIM

Queries to CONTENT_MAX_DIMENSIONS_URI will contain this column, populated with the maximum height and width (in pixels) that will be stored for a display photo. Larger photos will be down-sized to fit within a square of this many pixels.

Constant Value: "display_max_dim"

THUMBNAIL_MAX_DIM

added in API level 14
String THUMBNAIL_MAX_DIM

Queries to CONTENT_MAX_DIMENSIONS_URI will contain this column, populated with the height and width (in pixels) for photo thumbnails.

Constant Value: "thumbnail_max_dim"

Fields

CONTENT_MAX_DIMENSIONS_URI

added in API level 14
Uri CONTENT_MAX_DIMENSIONS_URI

This URI allows the caller to query for the maximum dimensions of a display photo or thumbnail. Requests to this URI can be performed on the UI thread because they are always unblocking.

CONTENT_URI

added in API level 14
Uri CONTENT_URI

The content:// style URI for this class, which allows access to full-size photos, given a key.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)