我经历过这个并找到了一个共同的答案,即
int selectedId = radioGroup.getCheckedRadioButtonId();
radioButton = (RadioButton) findViewById(selectedId);
Toast.makeText(MyAndroidAppActivity.this,
radioButton.getText(), Toast.LENGTH_SHORT).show();
Run Code Online (Sandbox Code Playgroud)
但是如何使用视图绑定获取文本呢?
android radio-group radio-button android-studio android-viewbinding