How to set radio button checked as default in radiogroup?

前端 未结 8 1564
孤城傲影
孤城傲影 2020-12-23 09:01

I have created RadioGroup and RadioButton dynamically as following:

RadioGroup radioGroup = new RadioGroup(context);
                      


        
8条回答
  •  攒了一身酷
    2020-12-23 09:10

    In the XML file set the android:checkedButton field in your RadioGroup, with the id of your default RadioButton:

    
    
        
    
        
    
        
    
    

提交回复
热议问题