I am trying to create an app that requires a login. Just to test to see how it works, I made a login button to go to a separate layout where you press a button to randomize numbers. The login button works fine and it brings me to another layout, but it is when I click the button on the separate layout that my app crashes.

here is my code:

```
private TextView R1;
private TextView R2;
private TextView R3;
private TextView R4;
private TextView R5;
private TextView R6;
private Animation R1_roll_rotate;
private Animation R2_roll_rotate;
private Animation R3_roll_rotate;
private Animation R4_roll_rotate;
private Animation R5_roll_rotate;
private Animation R6_roll_rotate;
private Button Randomize_Button;
private Animation Button_Rotate;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    Randomize_Button= (Button) findViewById(R.id.Randomize);
    R1= (TextView) findViewById(R.id.RandomOne);
    R2= (TextView) findViewById(R.id.RandomTwo);
    R3= (TextView) findViewById(R.id.RandomThree);
    R4= (TextView) findViewById(R.id.RandomFour);
    R5= (TextView) findViewById(R.id.RandomFive);
    R6= (TextView) findViewById(R.id.RandomSix);
    Button_Rotate= AnimationUtils.loadAnimation(Main_Activity.this, R.anim.Button_Rotate);
    R1_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomOne_roll_rotate);
    R2_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomTwo_roll_rotate);
    R3_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomThree_roll_rotate);
    R4_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomFour_roll_rotate);
    R5_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomFive_roll_rotate);
    R6_roll_rotate = AnimationUtils.loadAnimation(Main_Activity.this, R.anim.RandomSix_roll_rotate);

public void onClick(View view) {
    int randomnum1 = r.nextInt(70);
    int randomnum2 = r.nextInt(70);
    int randomnum3 = r.nextInt(70);
    int randomnum4 = r.nextInt(70);
    int randomnum5 = r.nextInt(70);
    int randomnum6 = r.nextInt(27);
    int num1 = randomnum1;
    int num2 = randomnum2;
    int num3 = randomnum3;
    int num4 = randomnum4;
    int num5 = randomnum5;
    int num6 = randomnum6;
    String randomnum7 = String.valueOf(randomnum1);
    String randomnum8 = String.valueOf(randomnum2);
    String randomnum9 = String.valueOf(randomnum3);
    String randomnum10 = String.valueOf(randomnum4);
    String randomnum11 = String.valueOf(randomnum5);
    String randomnum12 = String.valueOf(randomnum6);
    try {
        Randomize_Button.startAnimation(Button_Rotate);
        R1.startAnimation(R1_roll_rotate);
        R2.startAnimation(R2_roll_rotate);
        R3.startAnimation(R3_roll_rotate);
        R4.startAnimation(R4_roll_rotate);
        R5.startAnimation(R5_roll_rotate);
        R6.startAnimation(R6_roll_rotate);*/

        for (int i = num1; i > 0 && i == num1; i++) {
            String ii = Integer.toString(i);
            R1.setText(ii);
        }
        for (int j = num2; j > 0 && j == num2; j++) {
            String jj = Integer.toString(j);
            R2.setText(jj);
        }
        for (int k = num3; k > 0 && k == num3; k++) {
            String kk = Integer.toString(k);
            R3.setText(kk);
        }
        for (int d = num4; d > 0 && d == num4; d++) {
            String dd = Integer.toString(d);
            R4.setText(dd);
        }
        for (int s = num5; s > 0 && s == num5; s++) {
            String ss = Integer.toString(s);
            R5.setText(ss);
        }
        for (int g = num6; g > 0 && g == num6; g++) {
            String gg = Integer.toString(g);
            R6.setText(gg);
        }
        for (int g = num1; g == num2; g++) {
            g = r.nextInt(70);
            String gg = Integer.toString(g);
            R1.setText(gg);
        }
        for (int d = num1; d == num3; d++) {
            d = r.nextInt(70);
            String dd = Integer.toString(d);
            R1.setText(dd);
        }
        for (int a = num1; a == num3; a++) {
            a = r.nextInt(70);
            String aa = Integer.toString(a);
            R1.setText(aa);
        }
        for (int w = num1; w == num4; w++) {
            w = r.nextInt(70);
            String ww = Integer.toString(w);
            R1.setText(ww);
        }
        for (int q = num1; q == num5; q++) {
            q = r.nextInt(70);
            String qq = Integer.toString(q);
            R1.setText(qq);
        }
        for (int y = num2; y == num3; y++) {
            y = r.nextInt(70);
            String yy = Integer.toString(y);
            R2.setText(yy);
        }
        for (int o = num2; o == num4; o++) {
            o = r.nextInt(70);
            String oo = Integer.toString(o);
            R2.setText(oo);
        }
        for (int p = num2; p == num5; p++) {
            p = r.nextInt(70);
            String pp = Integer.toString(p);
            R2.setText(pp);
        }
        for (int x = num3; x == num4; x++) {
            x = r.nextInt(70);
            String xx = Integer.toString(x);
            R3.setText(xx);
        }
        for (int c = num3; c == num5; c++) {
            c = r.nextInt(70);
            String cc = Integer.toString(c);
            R3.setText(cc);
        }
        for (int b = num4; b == num5; b++) {
            b = r.nextInt(70);
            String bb = Integer.toString(b);
            R4.setText(bb);
        }
    } catch (Exception e){

        Toast.makeText(Main_Activity.this,e.getMessage(), Toast.LENGTH_SHORT).show();
    }
}

```

Does anyone know why? If so, your help would be deeply appreciated! Thanks.