I've created a RadioGroup
with 3% internal%, but I can not fit a code that causes the user to select a RadioButton
to be prevented from selecting another one.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="O que você coloca em uma torradeira?"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="@android:color/black"
android:textStyle="bold"/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/rgRespostas">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rbResposta1"
android:text="Torrada"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rbResposta2"
android:text="Bolo"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rbResposta3"
android:text="Pão"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"/>
</RadioGroup>
</LinearLayout>