我试图从图像的路径中获取位图图像。但BitmapFactory.decodeStream
返回null
值。
代码:
URL url = new URL(path);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
connection.disconnect();
input.close();
我搜索了更多网站,但我仍然没有得到解决方案。