android-radiogroup
How to bind method on RadioGroup on checkChanged event with data-binding
After digging to the bunch of methods, I found this question on SO which helped me understand how to bind single methods of listeners. Here is what to do with RadioGroup: In RadioGroup listener you have a method onCheckedChanged(RadioGroup g, int id). So you can directly bound that method to your handler or your activity … Read more
Android: RadioGroup – How to configure the event listener
This is how you get the checked radiobutton: // This will get the radiogroup RadioGroup rGroup = (RadioGroup)findViewById(r.id.radioGroup1); // This will get the radiobutton in the radiogroup that is checked RadioButton checkedRadioButton = (RadioButton)rGroup.findViewById(rGroup.getCheckedRadioButtonId()); To use the listener, you do this: // This overrides the radiogroup onCheckListener rGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { public void onCheckedChanged(RadioGroup group, int … Read more
Set selected index of an Android RadioGroup
If your radio group is defined in a layout xml file, each button can be assigned an id. Then you just check a button like this radioGroup.check(R.id.myButtonId); If you created your radio group programmatically (I’m not even sure how you do this…), you might want to consider creating a special layout xml file just for … Read more