Skip to main content

Posts

Selecting a button color of the screen will change.

Q8.Create an application with three buttons vertically aligned, on selecting a button color of the screen will change. Android Program :   Activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/layout"     android:layout_width="match_parent"     android:layout_height="match_parent"    android:orientation="horizontal"     tools:context="com.kishanhaldar.program8.MainActivity">     <Button         android:text="Red"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:id="@+id/red"  ...

Radio Button Example

Q7. 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. Android program : Activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/activity_main"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:paddingBottom="@dimen/activity_vertical_margin"     android:paddingLeft="@dimen/activity_horizontal_margin"     android:paddingRight="@dimen/activity_horizontal_margin"     android:paddingTop="@dimen/activity_vertical_margin"     android:orientation="vertical"     tools:cont...