This is a part of my code:
int n= random.nextInt(images.length - 1);
iv.setImageResource(images[n]);
Int n choose one of the indexes randomly and then I used ImageResource to show pictures according to the the random indexes. Now I want to add n to ArrayList. How should I do it? Is there any better way to save a value in memory in android?