ImageView imageview = (ImageView) findById(R.id.imagemXml);
imageview.setImageResource(R.drawable.imagem1);
But it is best practice to actually save the link to the image in the database (better yet: save the link to an external database), and not the image in the drawable folder...
Then you upload the link and the user will download the image.
I advise the use of the library Glide to do this automatically.
Stays: Glide.with(this).load("www.imagem.com.br/img1").into(imageview)
No load can also place drawable images.
Stays: Glide.with(this).load(R.drawable.imagem1).into(imageview)
You can still make an int array and hold all the images in the drawable folder (because R.drawable.img is int) and save in the database only the position of that array...
at position 10 is the image of a giraffe...so every time the program opens, the array is loaded and at position 10 the returned database will be the image of the giraffe... Stays: Glide.with(this).load(arrayDeImagens[10]).into(imageview)
Thank you! I will search about the Glide library.
– Everton Alves