i making app android, , need number, keep changing randomly every time call it.
but, if this:
random r = new random(); // makes random r public int rndnum = r.nextint(1000) + 7; and use rndnum few times, remains same randomly generated number every time.
is there way keep regenerating random number?
maybe try securerandom class : https://docs.oracle.com/javase/7/docs/api/java/security/securerandom.html
initialization in expensive can initialize securerandom once @ startup of application , keep using it.
Comments
Post a Comment