【发布时间】:2014-04-24 10:16:23
【问题描述】:
我正在从我的手机联系人列表中获取我的联系人图片 uri。
但是,当我尝试将图像 uri 转换为位图时出现错误:
java.io.FileNotFoundException: content://com.android.contacts/contacts/24093/photo
它与我设备上的旧照片有关,好像我拍了一张新照片它显示正常。
所以可能是旧照片太大或者不行,但是异常说java.io.FileNotFoundException
我如何验证这是访问权限问题?
final Bitmap bitmap;
try {
bitmap = MediaStore.Images.Media.getBitmap(ab.getContentResolver(), tryUri);
ab.runOnUiThread(new Runnable() {
@Override
public void run() {
// make sure the tag is still the one we set at the beginning of this function
if (toSet.getTag() == urlStr) {
toSet.setImageBitmap(bitmap);
}
}
});
} catch (FileNotFoundException e) {
String a = "1";
} catch (IOException e) {
String a = "1";
} catch (Exception e) {
String a = "1";
}
【问题讨论】: