• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare ImageView and a drawable picture  RSS feed

 
A. Aka
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How I can test that R.drawable.picture_1 and img1.getId() are equals
because they are pointing on the same picture

actually I am displaying NOT OK


 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ImageView#getId() gets the id of the ImageView, not the image displayed in the view. So img.getId() should return R.id.imageView1 not R.drawable.picture_1. So what problem are you actually trying to solve? Because comparing the id of the Drawable and the id of the ImageView is not a useful exercise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!