카테고리 없음

[기계적 인조 인간] 안드로이드에서 라디오 버튼의 선택된 (정수) ID를 얻는 방법

행복을전해요 2021. 1. 23. 06:47

ID를 켤 수 있습니다.

switch(checkedId) {
  case R.id.name_of_fist_radiobutton:
     /// my operation form 1;
        break;
           case R.id.name_of_second_radiobutton:
              /// my operation form 2;
                 break;
                 }
                 
-------------------

가치를 얻으려면 이것을 시도하십시오.

String radiovalue=  (RadioButton)this.findViewById(group.getCheckedRadioButtonId())).getText().toString();


출처
https://stackoverflow.com/questions/22009873