Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 在Kotlin的Android studio中,如何从单选按钮组中选定的单选按钮获取文本?_Android Studio_Kotlin_Radio Button_Radio Group - Fatal编程技术网

Android studio 在Kotlin的Android studio中,如何从单选按钮组中选定的单选按钮获取文本?

Android studio 在Kotlin的Android studio中,如何从单选按钮组中选定的单选按钮获取文本?,android-studio,kotlin,radio-button,radio-group,Android Studio,Kotlin,Radio Button,Radio Group,我一直在努力解决这个问题。我有随机测验的所有选项,存储在测验单选按钮组中的单选按钮中。然后,我想将所选单选按钮文本与存储为变量的答案进行比较 radioButton.text==您的\u字符串?radioButton.text==您的\u字符串?不,不起作用。谢谢你。我想我找到了一个方法。不,没用。谢谢你。我想我找到了一个方法。只要使用if(radioButton.isChecked()&&radioButton.text==答案)只要使用if(radioButton.isChecked()&&

我一直在努力解决这个问题。我有随机测验的所有选项,存储在测验单选按钮组中的单选按钮中。然后,我想将所选单选按钮文本与存储为变量的答案进行比较

radioButton.text==您的\u字符串?

radioButton.text==您的\u字符串?

不,不起作用。谢谢你。我想我找到了一个方法。不,没用。谢谢你。我想我找到了一个方法。只要使用if(radioButton.isChecked()&&radioButton.text==答案)只要使用if(radioButton.isChecked()&&radioButton.text==答案)