0

Android Radio Button and Radio Group Example Code

main.xml [code language=”css”] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:textSize="20dp" android:textStyle="bold" android:textColor="#fff" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:text="How was today’s tutorial ?"></TextView> <RadioGroup android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/rgOpinion"> <RadioButton android:layout_width="wrap_content" android:id="@+id/radio0" android:layout_height="wrap_content" android:checked="true" android:text="Excellent"></RadioButton> <RadioButton android:id="@+id/radioButton1"… Continue Reading