Reputation: 43943
In android, if you create an imageview in the xml code like this:
<ImageView
android:id="@+id/picture_avatar"
android:layout_width="90dp"
android:layout_height="110dp"
android:background="#bdbdbd" />
How can you tell in the java code, if it has a set image?
There is another button that sets an image using the setImageBitmap
function. So I want to tell if it has an image or not.
Thanks
Upvotes: 1
Views: 6830
Reputation: 14377
pictureavatar.getDrawable() == null
If true, then no image else it has an image
Upvotes: 3