Build 1.0_r1(from source)

android.app
Class TimePickerDialog

java.lang.Object
  extended by android.app.Dialog
      extended by android.app.AlertDialog
          extended by android.app.TimePickerDialog
All Implemented Interfaces:
DialogInterface, DialogInterface.OnClickListener, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback, TimePicker.OnTimeChangedListener

public class TimePickerDialog
extends AlertDialog
implements DialogInterface.OnClickListener, TimePicker.OnTimeChangedListener

A dialog that prompts the user for the time of day using a TimePicker.


Nested Class Summary
static interface TimePickerDialog.OnTimeSetListener
          The callback interface used to indicate the user is done filling in the time (they clicked on the 'Set' button).
 
Nested classes/interfaces inherited from class android.app.AlertDialog
AlertDialog.Builder
 
Nested classes/interfaces inherited from interface android.content.DialogInterface
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener
 
Field Summary
(package private)  int mInitialHourOfDay
           
(package private)  int mInitialMinute
           
(package private)  boolean mIs24HourView
           
 
Fields inherited from class android.app.Dialog
mCancelable, mContext, mDecor, mWindow, mWindowManager
 
Fields inherited from interface android.content.DialogInterface
BUTTON1, BUTTON2, BUTTON3
 
Constructor Summary
TimePickerDialog(Context context, int theme, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView)
           
TimePickerDialog(Context context, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView)
           
 
Method Summary
 void onClick(DialogInterface dialog, int which)
          This method will be invoked when a button in the dialog is clicked.
 void onRestoreInstanceState(Bundle savedInstanceState)
          Restore the state of the dialog from a previously saved bundle.
 Bundle onSaveInstanceState()
          Saves the state of the dialog into a bundle.
 void onTimeChanged(TimePicker view, int hourOfDay, int minute)
           
 void updateTime(int hourOfDay, int minutOfHour)
           
 
Methods inherited from class android.app.AlertDialog
onCreate, onKeyDown, onKeyUp, setButton, setButton, setButton2, setButton2, setButton3, setButton3, setCustomTitle, setIcon, setIcon, setInverseBackgroundForced, setMessage, setTitle, setView
 
Methods inherited from class android.app.Dialog
addContentView, cancel, closeOptionsMenu, dismiss, dispatchKeyEvent, dispatchOnCreate, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, isShowing, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onKeyMultiple, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOwnerActivity, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.content.DialogInterface
cancel, dismiss
 

Field Detail

mInitialHourOfDay

int mInitialHourOfDay

mInitialMinute

int mInitialMinute

mIs24HourView

boolean mIs24HourView
Constructor Detail

TimePickerDialog

public TimePickerDialog(Context context,
                        TimePickerDialog.OnTimeSetListener callBack,
                        int hourOfDay,
                        int minute,
                        boolean is24HourView)
Parameters:
context - Parent.
callBack - How parent is notified.
hourOfDay - The initial hour.
minute - The initial minute.
is24HourView - Whether this is a 24 hour view, or AM/PM.

TimePickerDialog

public TimePickerDialog(Context context,
                        int theme,
                        TimePickerDialog.OnTimeSetListener callBack,
                        int hourOfDay,
                        int minute,
                        boolean is24HourView)
Parameters:
context - Parent.
theme - the theme to apply to this dialog
callBack - How parent is notified.
hourOfDay - The initial hour.
minute - The initial minute.
is24HourView - Whether this is a 24 hour view, or AM/PM.
Method Detail

onClick

public void onClick(DialogInterface dialog,
                    int which)
Description copied from interface: DialogInterface.OnClickListener
This method will be invoked when a button in the dialog is clicked.

Specified by:
onClick in interface DialogInterface.OnClickListener
Parameters:
dialog - The dialog that received the click.
which - The button that was clicked, i.e. BUTTON1 or BUTTON2 or the position of the item clicked.

onTimeChanged

public void onTimeChanged(TimePicker view,
                          int hourOfDay,
                          int minute)
Specified by:
onTimeChanged in interface TimePicker.OnTimeChangedListener
Parameters:
view - The view associated with this listener.
hourOfDay - The current hour.
minute - The current minute.

updateTime

public void updateTime(int hourOfDay,
                       int minutOfHour)

onSaveInstanceState

public Bundle onSaveInstanceState()
Description copied from class: Dialog
Saves the state of the dialog into a bundle. The default implementation saves the state of its view hierarchy, so you'll likely want to call through to super if you override this to save additional state.

Overrides:
onSaveInstanceState in class Dialog
Returns:
A bundle with the state of the dialog.

onRestoreInstanceState

public void onRestoreInstanceState(Bundle savedInstanceState)
Description copied from class: Dialog
Restore the state of the dialog from a previously saved bundle. The default implementation restores the state of the dialog's view hierarchy that was saved in the default implementation of Dialog.onSaveInstanceState(), so be sure to call through to super when overriding unless you want to do all restoring of state yourself.

Overrides:
onRestoreInstanceState in class Dialog
Parameters:
savedInstanceState - The state of the dialog previously saved by Dialog.onSaveInstanceState().

Build 1.0_r1(from source)

Please submit a feedback, bug or feature