Mukunda Mukunda - 6 months ago 15
Android Question

how to check if an ImageView is attached with image in android

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.

PC. PC.
Answer

imageViewOne.getVisibility() == 0

use this instead:

imageViewOne.getDrawable() == null
Comments