How to compare Drawables? [duplicate]

3

asked by anonymous 19.04.2015 / 01:15

1 answer

0

Jeiferson, a possible workaround would be to set a tag on the button, where the tag would be the drawable id.

Example:

meuLindoBotao.setTag(R.drawable.imagemAtual);    
int imagemDoMeuLindoBotao = (Integer) meuLindoBotao.getTag(); //vai retornar o id do drawable atual

Once you've done that, you just need to compare the id with whatever you want!

I hope I have helped!

    
19.04.2015 / 19:21