I have images inside drawable
and to access it, R.drawable.myimage
is sufficient.
How do I store these images in vetor
?
I have images inside drawable
and to access it, R.drawable.myimage
is sufficient.
How do I store these images in vetor
?
Do not save the images, save your resource Id using a int[]
:
int[] imagensIds = {
R.drawable.image1,
R.drawable.image2,
R.drawable.image3
};
You can pass all images to a method:
processaImagens(imagensIds);
or just one:
processaImagem(imagensIds[1]);
Declare the methods as follows:
private processaImagens(int[] imagensIds){
}
private processaImagem(int imagemId){
}