How to compare imageview tag with other imageview backgroundresource in android
if (imageview1.getTag() == imageview2.getbackground()) {
// do something
}
Can we do it like this?
How to compare imageview tag with other imageview backgroundresource in android
if (imageview1.getTag() == imageview2.getbackground()) {
// do something
}
Can we do it like this?
This is definitely feasible. I mean, you can use a drawable as a tag in an imageView
. Since ==
just checks if they are the same instance, this comparison should work.
However, it is terribly inefficient to use a Drawable
as a tag.
Also, what is your problem? What are you trying to do? What is not working the way you want it to work?
I feel like your question needs to tell us more before it can be answered.