Q7
Question 7
Create a radio button group with radio button of all courses in your college and on selecting a particular course, teacher-in-charge of that course should appear at the bottom of the screen.

Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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"
tools:context=".MainActivity"
>
<TextView
android:id="@+id/t1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="@string/radio_button_demo" />
<RadioGroup
android:id="@+id/rg1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="150dp"
android:paddingLeft="50dp"
>
<RadioButton
android:id="@+id/rb1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Python Programming" />
<RadioButton
android:id="@+id/rb2"
android:layout_width="229dp"
android:layout_height="wrap_content"
android:text="Internet Technologies" />
<RadioButton
android:id="@+id/rb3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="DBMS" />
<RadioButton
android:id="@+id/rb4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Operating Systems" />
<RadioButton
android:id="@+id/rb5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Java Programming" />
</RadioGroup>
</RelativeLayout>
Download Q7_Radio_Buttons.apk to Run and Test Locally
Output












Last updated