返回值为null
为什么我的BitmapFactory.decodeString返回值是null,求解释,我是跟着老师一步一步做的啊
为什么我的BitmapFactory.decodeString返回值是null,求解释,我是跟着老师一步一步做的啊
2016-03-15
这里应该是decodeStream,你代码敲错了。
try {
connection=new URL(url).openConnection();
is=connection.getInputStream();
BufferedInputStream bis=new BufferedInputStream(is);
//通过decodeStream解析输入流
bitmap=BitmapFactory.decodeStream(bis);
is.close();
bis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}举报