0
我想要將未隱藏的聯繫人圖片照片設置爲Android 2.0以上的全屏圖像背景。我用下面的代碼來獲得裁剪縮略圖但照片是全屏幕的畫廊,我如何才能獲得這張照片未隱藏的聯繫人照片
該代碼給出了裁剪的縮略圖,如何獲取uncropped的全屏
public static Bitmap loadContactPhoto(ContentResolver cr, long id) {
Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);
if (input == null) {
return null;
}
return BitmapFactory.decodeStream(input);
}
聯繫人已被棄用需要使用ContactsContract API V5及以上則不能看到一種方式來獲得高分辨率的圖像,直到它有一些API API 14輕鬆搞定但如何運行Android 2.0-2.3的手機 – tech74
如果你找不到任何東西,我建議你使用它,你可以升級你的應用程序與一個新的版本,當最後刪除聯繫人。關於'棄用'的討論http://stackoverflow.com/questions/10297293/andorid-how-can-i-replace-the-deprecated-tabhost可能是有用的。 –
道歉DISPLAY_PHOTO字段你以上只有API 14及以上,所以看起來像V4.0之前,只有縮略圖 – tech74