#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Radio Button group logic


    Hi,
    I am trying to implement the logic for radio button group but it is not working. I want it to work like...

    If radio button1 is selected and submit is clicked, activity1 is seen and if radio button2 is selected and submit is clicked, activity2 is seen.

    can any one help me plz?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by Edu Varta
    Hi,
    I am trying to implement the logic for radio button group but it is not working. I want it to work like...

    If radio button1 is selected and submit is clicked, activity1 is seen and if radio button2 is selected and submit is clicked, activity2 is seen.

    can any one help me plz?
    Make onClick listener for each radio button on Radio Group

    PHP Code:
    public void onRadioButtonClicked(View view) {
            
    // Is the button now checked?
            
    boolean checked = ((RadioButtonview).isChecked();
            
            
    // Check which radio button was clicked
            
    switch(view.getId()) {
                case 
    R.id.radio0:
                    if (
    checked)
                           
    // start your activity 1 here
                    
    break;
                case 
    R.id.radio1:
                    if (
    checked)
                            
    // start your activity 2 here
                    
    break;
            }
        } 
  4. #3
  5. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    21
    Rep Power
    0
    Originally Posted by nghien_rbc
    Make onClick listener for each radio button on Radio Group

    PHP Code:
    public void onRadioButtonClicked(View view) {
            
    // Is the button now checked?
            
    boolean checked = ((RadioButtonview).isChecked();
            
            
    // Check which radio button was clicked
            
    switch(view.getId()) {
                case 
    R.id.radio0:
                    if (
    checked)
                           
    // start your activity 1 here
                    
    break;
                case 
    R.id.radio1:
                    if (
    checked)
                            
    // start your activity 2 here
                    
    break;
            }
        } 
    Not working any other solution ?

IMN logo majestic logo threadwatch logo seochat tools logo