5
To set an image in Imageview I did as follows using the setImageDrawable
:
imagem.setImageDrawable(ContextCompat.getDrawable(this,R.drawable.cliente));
While searching for Imageview I also found the method setImageResource
and it also worked that way:
imagem.setImageResource(R.drawable.cliente);
However I did not find the difference between the methods and which one I should use in this situation, that depending on one information from another the method arrow the corresponding image.