How to get text of the checked id from radio group using view binding?

Solution 1:

You could do this:

EDIT:

int id = binding.radioGroup.getCheckedRadioButtonId();
RadioButton radioButton = binding.getRoot().findViewById(id);
//Then get the radio button's text
Toast.makeText(MyAndroidAppActivity.this,
        radioButton.getText(), Toast.LENGTH_SHORT).show();