android.app
Class TimePickerDialog
java.lang.Object
android.app.Dialog
android.app.AlertDialog
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). |
| 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 |
mInitialHourOfDay
int mInitialHourOfDay
mInitialMinute
int mInitialMinute
mIs24HourView
boolean mIs24HourView
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 dialogcallBack - How parent is notified.hourOfDay - The initial hour.minute - The initial minute.is24HourView - Whether this is a 24 hour view, or AM/PM.
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().
Please submit a feedback, bug or feature