Build 1.0_r1(from source)

android.app
Class DatePickerDialog

java.lang.Object
  extended by android.app.Dialog
      extended by android.app.AlertDialog
          extended by android.app.DatePickerDialog
All Implemented Interfaces:
DialogInterface, DialogInterface.OnClickListener, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback, DatePicker.OnDateChangedListener

public class DatePickerDialog
extends AlertDialog
implements DialogInterface.OnClickListener, DatePicker.OnDateChangedListener

A simple dialog containing an DatePicker.


Nested Class Summary
static interface DatePickerDialog.OnDateSetListener
          The callback used to indicate the user is done filling in the date.
 
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
 
Fields inherited from class android.app.Dialog
mCancelable, mContext, mDecor, mWindow, mWindowManager
 
Fields inherited from interface android.content.DialogInterface
BUTTON1, BUTTON2, BUTTON3
 
Constructor Summary
DatePickerDialog(Context context, DatePickerDialog.OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth)
           
DatePickerDialog(Context context, int theme, DatePickerDialog.OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth)
           
 
Method Summary
 void onClick(DialogInterface dialog, int which)
          This method will be invoked when a button in the dialog is clicked.
 void onDateChanged(DatePicker view, int year, int month, int day)
           
 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 show()
          Start the dialog and display it on screen.
 void updateDate(int year, int monthOfYear, int dayOfMonth)
           
 
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, 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
 

Constructor Detail

DatePickerDialog

public DatePickerDialog(Context context,
                        DatePickerDialog.OnDateSetListener callBack,
                        int year,
                        int monthOfYear,
                        int dayOfMonth)
Parameters:
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.

DatePickerDialog

public DatePickerDialog(Context context,
                        int theme,
                        DatePickerDialog.OnDateSetListener callBack,
                        int year,
                        int monthOfYear,
                        int dayOfMonth)
Parameters:
context - The context the dialog is to run in.
theme - the theme to apply to this dialog
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.
Method Detail

show

public void show()
Description copied from class: Dialog
Start the dialog and display it on screen. The window is placed in the application layer and opaque. Note that you should not override this method to do initialization when the dialog is shown, instead implement that in Dialog.onStart().

Overrides:
show in class Dialog

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.

onDateChanged

public void onDateChanged(DatePicker view,
                          int year,
                          int month,
                          int day)
Specified by:
onDateChanged in interface DatePicker.OnDateChangedListener
Parameters:
view - The view associated with this listener.
year - The year that was set.
month - The month that was set (0-11) for compatibility with Calendar.
day - The day of the month that was set.

updateDate

public void updateDate(int year,
                       int monthOfYear,
                       int dayOfMonth)

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