1 public void NextRandom(View view) // button clicked function
2 {
3 int previousIndex = index;
4 index = rand.nextInt(array.size());
5
6 while (index == previousIndex)
7 {
8 index = rand.nextInt(array.size());
9 }
10 }