protected void bindPhoto(final ContactListItemView view, int partitionIndex, Cursor cursor) { if (!isPhotoSupported(partitionIndex)) { view.removePhotoView(); return; } long photoId = 0; if (!cursor.isNull(PhoneQuery.PHOTO_ID)) { photoId = cursor.getLong(PhoneQuery.PHOTO_ID); } if (photoId != 0) { getPhotoLoader().loadThumbnail(view.getPhotoView(), photoId, false, getCircularPhotos(), null); } else { final String photoUriString = cursor.getString(PhoneQuery.PHOTO_URI); final Uri photoUri = photoUriString == null ? null : Uri.parse(photoUriString); DefaultImageRequest request = null; if (photoUri == null) { final String displayName = cursor.getString(PhoneQuery.DISPLAY_NAME); final String lookupKey = cursor.getString(PhoneQuery.LOOKUP_KEY); request = new DefaultImageRequest(displayName, lookupKey, getCircularPhotos()); } getPhotoLoader().loadDirectoryPhoto(view.getPhotoView(), photoUri, false, getCircularPhotos(), request); } }