【发布时间】:2019-11-16 16:30:45
【问题描述】:
对于 android 编程,我有一个 RadioGroup,其中包含一些 RadioButtons。 我只想从按钮中获取文本,而不需要获取 RadioButton 的 id。
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioGroup"
>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text1"
/>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text2"
/>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text3"
/>
</RadioGroup>
是否可以只获取文本?
【问题讨论】:
标签: java android xml text radio-button