public static int rnd(int min, int max){ Random rnd = new Random(); return min + rnd.nextInt(max - min); } public static int rnd(int max){ return rnd(0,max); } 

further in the code, a random number is generated in me

 _l2 = rnd(7); 

Big problem: the code works on the desktop, the numbers are generated normally, and when I run the same code on the android, in some cases I got that _l2 9.

Help.

  • The example you gave uses a method with one argument, but you gave a code for a method with 2 arguments. Maybe you just sealed somewhere? - Yuriy SPb
  • Forgot to specify the code of the second procedure. Changed the post, added the code. Forgive help. - Alexey Kremenetsky
  • one
    Maybe your InstantRun fails. Those. after changing the method parameter, the code on the device does not change and uses the old value. Try turning off InstantRun in studio settings - Yuriy SPb
  • I use eclipse mneeee ...... - Alexey Kremenetsky
  • I suspect that you statics fields operate in the calculations? On Android, this should be done very carefully. - woesss

0