Radio Button Default Check 버튼 설정

xml RadioGroup의 checkedButton을 이용한다.

<RadioGroup
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:checkedButton="@id/radioButton_a">
    
    <RadioButton
        android:id="@+id/radioButton_a"
        ....

 

 

Radio Group에서 체크된 버튼 확인

radioButton 속성의 isChecked를 이용한다.

val radioButton_a : RadioButton = view.findViewById(R.id.radioButton_a)

if(radioButton_a.isChecked == true){
	....
}