Sometimes, we need to capture date from user. If we forced our users to type required date then there is chance for mis-typing and also selecting a date is quite easy rather than type.
In android, we can use in built datePicker dialog to capture a date from user.
Step 1: Create a new project in Android Studio and name it Android date picker.
Step 2: Open res -> drawable and add a xml resource file with a name
Step 3: Open MainActivity.java and replace its code with below given code.
Step 4:Open res -> drawable -> activity_main.xml and replace the code with code of activity_main.xml with the below given code.activity_main.xml
Step 5:Clean and run your project to see the result.