if(bigimageS.length()==0){
show_image.setImageBitmap(null);
}else{
show_image.setImageBitmap(decodeImage(bigimageS));
}
****************
public static Bitmap decodeImage(String arrayList_image) {
BufferedInputStream bis;
URL aURL;
try{
aURL = new URL(arrayList_image);
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
bis = new BufferedInputStream(is);
Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
return bm;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
这是我的代码,我想清除 imageview。我的问题是我在 bigimages String 中获取图像。我在字符串 bigimages 中添加来自 w/s.in 的 imageurl。当我在一次图像设置后单击下一个 btn 时然后旧图像不清楚。所以请帮助我设置条件但不工作。请帮助。
我正在使用 decodeimage 来解码图像,如果字符串中没有 url,是否有任何方法可以清除。请帮助我,但还没有解决
最佳答案
从 photoshop 创建一个空白/透明的 png 图像,并将其用作图像背景。
关于android - 无法在android中的imageview中清除或设置空白图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12294474/