0% found this document useful (0 votes)
4 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
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
4 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
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
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