There are random number generators in Java (java.util.Random) and in
the crypto support.  Or you can dig up a reference and write your
own.  Or you can use the millisecond bits of the system clock.

If you use a good pseudo-random generator (and I assume that
java.util.Random is reasonably good) then the numbers should not
repeat (if you don't change the seed) for about two billion values.
Otherwise you need to guard against repeats by remembering the
previously-dispensed numbers and "re-rolling the dice" if a dupe
occurs.

On Mar 25, 7:45 am, Hassy <[email protected]> wrote:
> Hello,
>
> I want to display unique random numbers when button clicked.
> if a number appear once, that number should not appear again when
> button clicked.
> Please help me...
>
> Thank you
> Hassy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to