Android
android.app
public class

android.app.DatePickerDialog

java.lang.Object
android.app.Dialog DialogInterface KeyEvent.Callback View.OnCreateContextMenuListener Window.Callback
android.app.AlertDialog DialogInterface
android.app.DatePickerDialog DialogInterface.OnClickListener DatePicker.OnDateChangedListener

A simple dialog containing an DatePicker.

Nested Classes
DatePickerDialog.OnDateSetListener The callback used to indicate the user is done filling in the date. 

Summary

Constants inherited from interface android.content.DialogInterface
Fields inherited from class android.app.Dialog

Public Constructors

            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)

Public Methods

          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
Methods inherited from class android.app.Dialog
Methods inherited from class java.lang.Object
Methods inherited from interface android.content.DialogInterface
Methods inherited from interface android.content.DialogInterface.OnClickListener
Methods inherited from interface android.view.KeyEvent.Callback
Methods inherited from interface android.view.View.OnCreateContextMenuListener
Methods inherited from interface android.view.Window.Callback
Methods inherited from interface android.widget.DatePicker.OnDateChangedListener

Details

Public Constructors

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.

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.

Public Methods

public void onClick(DialogInterface dialog, int which)

This method will be invoked when a button in the dialog is clicked.

public void onDateChanged(DatePicker view, int year, int month, int day)

public void onRestoreInstanceState(Bundle savedInstanceState)

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 onSaveInstanceState(), so be sure to call through to super when overriding unless you want to do all restoring of state yourself.

Parameters

savedInstanceState The state of the dialog previously saved by onSaveInstanceState().

public Bundle onSaveInstanceState()

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.

Returns

  • A bundle with the state of the dialog.

public void show()

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 onStart().

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

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56