Deprecated: onCreateDialog

protected Dialog onCreateDialog (int id) was added in API level 1
Deprecated in API level 8.
Old no-arguments version of onCreateDialog(int, Bundle).
The onCreateDialog() method is overridden and called when the showDialog() method is called with a parameter.

1. Add a showDialog to your widget of choice.

2. In the MainActivity.java file, add the method below to the class. The showDatePicker() and showTimePicker() are methods you would need to create to display those Dialogs. ALERT_DIALOG refers to the constant you created when you created the showDialog.

@Override
protected Dialog onCreateDialog(int id) {
switch(id) {
case ALERT_DIALOG:
// return showAlertDialog();
        case 1:
            //return showTimePicker();
        case 2:
            //return showDatePicker();

    }
return super.onCreateDialog(id);
}

3. Compile and run!

Resources:
http://developer.android.com/reference/android/app/Activity.html#onCreateDialog(int)