Displaying a Date Picker dialog
In this recipe, you will learn to display a date picker dialog, allowing the user to scroll through days, months, and years to select the desired date.
How to do it...
In this recipe, we will be making use of the following methods:
dialogCreateDatePicker()
: This method is used to display the date with the specified initial datedialogGetResponse()
: This method is used to get the response, that is, the selection made by the userdialogDismiss()
: This method is used to make the dialog box invisible after a selection been made by the userget("day")
: This method is used to access the day in theDate
type objectget("month")
: This method is used to access the month in theDate
type objectget("year")
: This method is used to access the year in theDate
type object
Let's take a look at the following steps:
- Type the following code in the Python script
demoDateSelection.py
in the current folder of your computer:
import android app = android.Android() app.dialogCreateDatePicker...