0% found this document useful (0 votes)
21 views3 pages

Practical 16

The document contains XML code for a layout that implements a TimePicker in an Android application. It defines a RelativeLayout as the main container and includes a TimePicker set to 'clock' mode. The second output shows a modification where the TimePicker mode is changed to 'spinner'.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

Practical 16

The document contains XML code for a layout that implements a TimePicker in an Android application. It defines a RelativeLayout as the main container and includes a TimePicker set to 'clock' mode. The second output shows a modification where the TimePicker mode is changed to 'spinner'.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

// Program to implement TimePicker

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TimePicker
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:timePickerMode="clock"
/>
</RelativeLayout>

Output:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TimePicker
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:timePickerMode="spinner"
/>

</RelativeLayout>

Output:

You might also like