I am new to Android and also to java. in my application exactly what i need is random numbers.which will not be repeated once again.
for an example Say i have a TextView and a Button on clicking the button it should show me random numbers and those random numbers shoud not be repeated.
for this i was thinking to store the random data into array and check whether the random number is in the array or not .if it is not there in the array it will store that number for temporally .like on first click it should show me some random number like in between 1-20 say it selected 5, now this value should be stored into array and on clicking the next button if again 5 number come then it should skip this number .
Please help me regarding this,
Talking about the data structure to store your generated random consider using java.util.Set for storing unique set of numbers. TO check whether a number already exists in Set use Set#contains(Object o) method.
CODE: