如何检查是否ImageView的附有图片的安卓图片、ImageView

2023-09-06 01:24:04 作者:嘻嘻哈哈搞怪男i

我的图片设置为ImageView的android的code不在XML,但无法辨认出如何检查是否形象或没有在java中设定。

试图与 imageViewOne.getVisibility()== 0 但它不工作

如果图像已被设置为ImageView的话,我附上了图片发送邮件。

解决方案   

imageViewOne.getVisibility()== 0

用这个来代替:

  imageViewOne.getDrawable()== NULL
 

怎么弄电子照片

I am setting an image to ImageView in android code not in xml, but could not make out how to check whether that image has been set in or not in java.

Tried with imageViewOne.getVisibility() == 0 but it is not working

If image has been set to ImageView then I am attaching that image for sending mail.

解决方案

imageViewOne.getVisibility() == 0

use this instead:

imageViewOne.getDrawable() == null