VOOZH about

URL: https://www.geeksforgeeks.org/android/more-functionalities-of-material-design-date-picker-in-android/

⇱ More Functionalities of Material Design Date Picker in Android - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

More Functionalities of Material Design Date Picker in Android

Last Updated : 23 Jul, 2025

As discussed in the Material Design Date Picker in Android it offers many functionalities to users and is easy to implement for developers. So in this article, we are going to discuss more functionalities of material design date picker with examples. Note that the UI part will be the same as in the Part-1 article. We are going to work with the Java file only.  

Functionality 1: Block all the dates before today's date

This feature is very useful for a developer for avoiding users fromchoosingthe wrong date. A sample GIF is given below to get an idea about what we are going to do in this functionality.

👁 Sample GIF

Go to the MainActivity.java file, and refer to the following code. Below is the code for the MainActivity.java file. Comments are added inside the code to understand the code in more detail.

Output: Run on Emulator

Functionality 2: Select the today's date as the default selection as soon as the material date picker dialog opens

Have a look at the following image. 

👁 Sample Image

Go to the MainActivity.java file, and refer to the following code. Below is the code for the MainActivity.java file. Comments are added inside the code to understand the code in more detail. 

Output: Run on Emulator

Functionality 3: Make the user, select a date within bounds

For example, select the date from March 2020 to December 2020. A sample GIF is given below to get an idea about what we are going to do in this functionality.

👁 Sample GIF

Go to the MainActivity.java file, and refer to the following code. Below is the code for the MainActivity.java file. Comments are added inside the code to understand the code in more detail. 

Output: Run on Emulator

Functionality 4: Open the material date picker dialog at the specific month

For example, open the material date picker dialog in August month. A sample GIF is given below to get an idea about what we are going to do in this functionality. 

👁 Sample GIF

Go to the MainActivity.java file, and refer to the following code. Below is the code for the MainActivity.java file. Comments are added inside the code to understand the code in more detail. 

Output: Run on Emulator

Comment

Explore