Android -Random, case, switch

Random crazy = new Random();


switch(crazy.nextInt(3)){
case 0:
display.setGravity(Gravity.LEFT);
break;
case 1:
display.setGravity(Gravity.CENTER);
break;
case 2:
display.setGravity(Gravity.RIGHT);
break;

default setting is center

No comments:

Post a Comment