-1

Good day, May I know how to link main page to another activity page through radio button with button?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Shun Jian
  • 11
  • 1

1 Answers1

0
 final RadioButton admin = (RadioButton) findViewById(R.id.radio1);
 final RadioButton employee = (RadioButton) findViewById(R.id.radio2);
 final Button go = (Button) findViewById(R.id.button1);
       go.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View v) {
           if (admin.isChecked())
          {
            Intent Intents= new Intent(YourActivity.this, Admin.class); 
            startActivity(Intents);
           }
            else if (employee.isChecked())
           {
             Intent Intentm = new Intent(YourActivity.this, Employee.class); 
             startActivity(Intents);
            }
          }
         });

Hope this helps.

John Joe
  • 12,412
  • 16
  • 70
  • 135