Android Calendar View is a widget used for selecting  dates from the calendar, this View is much more comfortable than the previous date picker in my point of view you can use accordingly.

Android Tutorial on Date Picker

Calendar has got a good interface which is easier to understand because the basic calendar is available to view in android calendar view so that user can easily get selected date from android calendar view day view.   Also week number is displayed so that user can know the number of the week in the entire year,  android calendar view horizontal scroll will help you to scroll down to get next month appeared in the view and so on….

Calendar View also got many other features like calendar View month color, calendar View multiple dates, calendar view mark day, calendar view language, calendar view mark dates and many more so it much exciting for the previous users of date picker.

2. Creating activity_main.xml :

Adding a CalendarView to the layout.

3. Creating MainActivity.java :

Now initialize CalendarView and then  setonclicklistener

Full code :   And now click on the date you will get a toast displaying day, month, year as selected.

4. Output :

calendar1   calendar2

Show Buttons
Hide Buttons
Read previous post:
Android Tutorial on Image SlideShow

Close