如何从图库中获取图像,选择图像后,将其设置为图像视图
Uri uri = data.getData()
InputStream is = null
try
is = getContentResolver.openInputStream(uri)
catch (FileNotFoundException e)
e.printStackTrace();
Bitmap b = BitmapFactory.decodeStream(is);
imageView.setImageURI(uri);
在选择图片时,应用程序崩溃并发出错误 -
unable to decode stream : java.io.fileNotFoundException :
open failed : ENONENT (No such file or directory)
resolveUri failed on bad bitmap uri