Android 如何获取RadioGroup选中RadioButton的内容

Android 如何获取RadioGroup选中RadioButton的内容

radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { 

     @Override 
     public void onCheckedChanged(RadioGroup group, int checkedId) { 
        selectRadioBtn();
        }
     });
 }

 private void selectRadioBtn(){
    radioButton = (RadioButton)findViewById(radioGroup.getCheckedRadioButtonId());
    selectText = radioButton.getText().toString();
    }

你可能感兴趣的:(Android)