This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compare ImageView and a drawable picture

 
A. Aka
Ranch Hand
Posts: 97
  • 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