【问题标题】:How do you get the text from a selected radio button in a radio button group in Android studio in Kotlin?如何从 Kotlin 的 Android Studio 中的单选按钮组中的选定单选按钮中获取文本?
【发布时间】:2020-06-11 22:16:54
【问题描述】:

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

【问题讨论】:

  • 只使用 if(radioButton.isChecked() && radioButton.text == answer)

标签: android-studio kotlin radio-button radio-group


【解决方案1】:

radioButton.text == your_string ?

【讨论】:

  • 不,没用。不管怎么说,多谢拉。我想我找到了一种方法。
猜你喜欢
  • 2013-12-06
  • 1970-01-01
  • 2021-12-29
  • 1970-01-01
  • 1970-01-01
  • 2012-11-08
  • 1970-01-01
  • 2011-07-28
  • 2014-03-21
相关资源
最近更新 更多