English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.TimePicker

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.view.ViewGroup ViewManager ViewParent
android.widget.FrameLayout
android.widget.TimePicker

A view for selecting the time of day, in either 24 hour or AM/PM mode. The hour, each minute digit, and AM/PM (if applicable) can be conrolled by vertical spinners. The hour can be entered by keyboard input. Entering in two digit hours can be accomplished by hitting two digits within a timeout of about a second (e.g. '1' then '2' to select 12). The minutes can be entered by entering single digits. Under AM/PM mode, the user can hit 'a', 'A", 'p' or 'P' to pick.

Also see ViewGroup.LayoutParams for layout attributes.

For a dialog using this view, see TimePickerDialog.

Nested Classes
TimePicker.OnTimeChangedListener The callback interface used to indicate the time has been adjusted. 
TimePicker.OnTimeSetListener The callback interface used to indicate the user is done filling in the time (they clicked on the 'Set' button). 

Summary

XML Attributes inherited from class android.widget.FrameLayout
XML Attributes inherited from class android.view.ViewGroup
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.ViewGroup
Constants inherited from class android.view.View
Fields inherited from class android.widget.FrameLayout
Fields inherited from class android.view.ViewGroup
Fields inherited from class android.view.View

Public Constructors

          TimePicker(Context context, AttributeSet attrs, Map inflateParams)

Public Methods

        int  getBaseline()

Return the offset of the widget's text baseline from the widget's top boundary.

        Integer  getCurrentHour()
        Integer  getCurrentMinute()
        void  setCurrentHour(Integer currentHour)
Set the current hour.
        void  setCurrentMinute(Integer currentMinute)
Set the current minute (0-59).
        void  setIs24HourView(Boolean is24HourView)
Set whether in 24 hour or AM/PM mode.
        void  setOnTimeChangedListener(OnTimeChangedListener onTimeChangedListener)
Set the callback that indicates the time has been adjusted by the user.
        void  setOnTimeFilledIn(OnTimeSetListener onTimeSetListener)
Set the callback that indicates the time has been filled in (the user pressed the 'Set' button).
Methods inherited from class android.widget.FrameLayout
Methods inherited from class android.view.ViewGroup