public static class CreateEventActivity.DatePickerFragment
extends DialogFragment
implements android.app.DatePickerDialog.OnDateSetListener
Modifier and Type | Field and Description |
---|---|
private android.widget.DatePicker |
datePicker |
private int |
day |
private boolean |
isSet |
private int |
month |
private int |
year |
Constructor and Description |
---|
DatePickerFragment() |
Modifier and Type | Method and Description |
---|---|
android.widget.DatePicker |
getDatePicker()
Get the DatePicker
|
int |
getDay()
Get the selected day
|
int |
getMonth()
Get the selected month
|
int |
getYear()
Get the selected year
|
boolean |
isSet()
Check whether the user has set a date
|
android.app.Dialog |
onCreateDialog(android.os.Bundle savedInstanceState)
Called when the fragment is created
Sets the initial state of the calendar to the current date and returns the resulting
DatePickerDialog to display
|
void |
onDateSet(android.widget.DatePicker view,
int year,
int month,
int day)
When user sets the date, show their choice in the eventDate textView
|
private android.widget.DatePicker datePicker
private int year
private int month
private int day
private boolean isSet
public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
savedInstanceState
- Last saved state of fragmentpublic void onDateSet(android.widget.DatePicker view, int year, int month, int day)
onDateSet
in interface android.app.DatePickerDialog.OnDateSetListener
view
- The date picker shown via the fragmentyear
- Year the user chosemonth
- Month the user choseday
- Day the user chosepublic android.widget.DatePicker getDatePicker()
public int getYear()
public int getMonth()
public int getDay()
public boolean isSet()