我的图片设置为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