0
試圖從庫獲得的圖像,我的照片URI:content://com.android.providers.media.documents/document/image%3A15672
BitmapFactory.decodeStream返回空與bmOptions
當我不使用bmOptions(BitmapFactory.decodeStream(inStream))
我得到位圖圖像成功地,但是當我添加bmOptions BitmapFactory.decodeStream(inStream,null,bmOptions))
我得到null
位圖,無法找出做錯了。
private void setPic(Uri photoUri) {
InputStream inStream = null;
try {
inStream = getContentResolver().openInputStream(photoUri);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
Log.i("response", "INPUT STREAM| Bitmap : "+ BitmapFactory.decodeStream(inStream,null,bmOptions));
}
恰到好處:) –