Android 如何獲取RadioGroup選中RadioButton的內容

yangxi_001發表於2014-04-16
 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();
    }

相關文章