public class DatePickerDialog
extends android.support.v7.app.AlertDialog
implements android.content.DialogInterface.OnClickListener, android.widget.DatePicker.OnDateChangedListener
DatePicker.
See the Pickers guide.
| Modifier and Type | Class and Description |
|---|---|
static interface |
DatePickerDialog.OnDateSetListener
The callback used to indicate the user is done filling in the date.
|
android.support.v7.app.AlertDialog.Builderandroid.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Constructor and Description |
|---|
DatePickerDialog(android.content.Context context,
DatePickerDialog.OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth) |
DatePickerDialog(android.content.Context context,
int theme,
DatePickerDialog.OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth) |
| Modifier and Type | Method and Description |
|---|---|
android.widget.DatePicker |
getDatePicker()
Gets the
DatePicker contained in this dialog. |
void |
onClick(android.content.DialogInterface dialog,
int which) |
void |
onDateChanged(android.widget.DatePicker view,
int year,
int month,
int day) |
void |
onRestoreInstanceState(android.os.Bundle savedInstanceState) |
android.os.Bundle |
onSaveInstanceState() |
protected void |
onStop() |
void |
setMode() |
void |
updateDate(int year,
int monthOfYear,
int dayOfMonth)
Sets the current date.
|
getButton, getListView, onCreate, onKeyDown, onKeyUp, setButton, setButton, setButton, setCustomTitle, setIcon, setIcon, setIconAttribute, setMessage, setTitle, setView, setViewaddContentView, dispatchKeyEvent, findViewById, getDelegate, getSupportActionBar, invalidateOptionsMenu, onSupportActionModeFinished, onSupportActionModeStarted, onWindowStartingSupportActionMode, setContentView, setContentView, setContentView, setTitle, supportRequestWindowFeaturecancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, 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, onSearchRequested, onStart, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, requireViewById, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenupublic DatePickerDialog(android.content.Context context,
DatePickerDialog.OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth)
context - The context the dialog is to run in.callBack - How the parent is notified that the date is set.year - The initial year of the dialog.monthOfYear - The initial month of the dialog.dayOfMonth - The initial day of the dialog.public DatePickerDialog(android.content.Context context,
int theme,
DatePickerDialog.OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth)
context - The context the dialog is to run in.theme - the theme to apply to this dialogcallBack - How the parent is notified that the date is set.year - The initial year of the dialog.monthOfYear - The initial month of the dialog.dayOfMonth - The initial day of the dialog.public void onClick(android.content.DialogInterface dialog,
int which)
onClick in interface android.content.DialogInterface.OnClickListenerpublic void onDateChanged(android.widget.DatePicker view,
int year,
int month,
int day)
onDateChanged in interface android.widget.DatePicker.OnDateChangedListenerpublic android.widget.DatePicker getDatePicker()
DatePicker contained in this dialog.public void updateDate(int year,
int monthOfYear,
int dayOfMonth)
year - The date year.monthOfYear - The date month.dayOfMonth - The date day of month.protected void onStop()
onStop in class android.support.v7.app.AppCompatDialogpublic android.os.Bundle onSaveInstanceState()
onSaveInstanceState in class android.app.Dialogpublic void onRestoreInstanceState(android.os.Bundle savedInstanceState)
onRestoreInstanceState in class android.app.Dialogpublic void setMode()