public class TimePickerDialog extends AlertDialog implements DialogInterface.OnClickListener, TimePicker.OnTimeChangedListener
TimePicker
.
See the Pickers guide.
Modifier and Type | Class and Description |
---|---|
static interface |
TimePickerDialog.OnTimeSetListener
The callback interface used to indicate the user is done filling in
the time (they clicked on the 'Set' button).
|
AlertDialog.Builder
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
THEME_DEVICE_DEFAULT_DARK, THEME_DEVICE_DEFAULT_LIGHT, THEME_HOLO_DARK, THEME_HOLO_LIGHT, THEME_TRADITIONAL
mCancelable
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected void |
onStop()
Called to tell you that you're stopping.
|
void |
onTimeChanged(TimePicker view,
int hourOfDay,
int minute) |
void |
updateTime(int hourOfDay,
int minutOfHour) |
getButton, getListView, onCreate, onKeyDown, onKeyUp, setButton, setButton, setButton, setButton, setButton2, setButton2, setButton3, setButton3, setCustomTitle, setIcon, setIcon, setIconAttribute, setInverseBackgroundForced, setMessage, setTitle, setView, setView
addContentView, cancel, closeOptionsMenu, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyShortcut, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onSearchRequested, onStart, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, dismiss
public TimePickerDialog(Context context, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView)
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.public TimePickerDialog(Context context, int theme, TimePickerDialog.OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView)
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.public void onClick(DialogInterface dialog, int which)
DialogInterface.OnClickListener
onClick
in interface DialogInterface.OnClickListener
dialog
- The dialog that received the click.which
- The button that was clicked (e.g.
DialogInterface.BUTTON1
) or the position
of the item clicked.public void updateTime(int hourOfDay, int minutOfHour)
public void onTimeChanged(TimePicker view, int hourOfDay, int minute)
onTimeChanged
in interface TimePicker.OnTimeChangedListener
view
- The view associated with this listener.hourOfDay
- The current hour.minute
- The current minute.protected void onStop()
Dialog
public Bundle onSaveInstanceState()
Dialog
onSaveInstanceState
in class Dialog
public void onRestoreInstanceState(Bundle savedInstanceState)
Dialog
Dialog.onSaveInstanceState()
,
so be sure to call through to super when overriding unless you want to
do all restoring of state yourself.onRestoreInstanceState
in class Dialog
savedInstanceState
- The state of the dialog previously saved by
Dialog.onSaveInstanceState()
.