generate random number in java within a range without repeating with android studio

Solutions on MaxInterview for generate random number in java within a range without repeating with android studio by the best coders in the world

showing results for - "generate random number in java within a range without repeating with android studio"
Karl
28 May 2016
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    }