Having a
imagem = (ImageView) findViewById(R.id.imageViewId);
How do I know if the current image has the name x or y?
I tried some forms, with the equals and such, but it did not work ....
if (imagem.equals("nome")){...
Having a
imagem = (ImageView) findViewById(R.id.imageViewId);
How do I know if the current image has the name x or y?
I tried some forms, with the equals and such, but it did not work ....
if (imagem.equals("nome")){...
I suppose when you say "image name" you are referring to the ID assigned by android:id
or setId()
, in this case R.id.imageViewId
.
If so, use the imagem.getId()
method to get the ID you have been assigned:
if (imagem.getId() == R.id.imageViewId){...