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();
    }
展开阅读全文

没有更多推荐了,返回首页