I have an image view on android, would you like to know how I can perform the exchange of this image via code? Thanks
I have an image view on android, would you like to know how I can perform the exchange of this image via code? Thanks
Try this:
ImageView img= (ImageView) findViewById(R.id.image_id);
img.setImageResource(R.drawable.nova_imagem);
Or
ImageView img= (ImageView) findViewById(R.id.image_id);
Bitmap bitImage = BitmapFactory.decodeResource(this.getResources(), R.drawable.minha_nova_imagem);
img.setImageBitmap(bImage);
Greetings!