Date Pickers let you pick a date that is correctly formatted and adjusted to the user’s locale.
It’s best to show your DatePicker in a Dialog Fragment which has been around since API Level 11.
We’ll show you how to use a DatePicker in a Dialog Fragment on device’s running API Level 4 and above.
We use the support library’s DialogFragment. You can use the platform version of DialogFragment if you’re developing for API Level 11 and higher.