I want to write a banal application in which there will be a calendar with events, so that when you first click on a date, the date is selected and colored up to the next selected date or the next 7 days.

I created a calendar:

calendarView = Calendar.getInstance(); 

Tried to do in:

 calendarView.setDate(1484784000000L); 

more than one date, alas, can not be set and when you click on another date, the previous date gets lost.

The next attempt was to make it through:

 calendarView.setMinDate(1484870400000L); calendarView.setMaxDate(1485302400000L); 

but again, it does not allow you to make several choices, only one, that is, this option does not work:

 calendarView.setMinDate(1484870400000L); calendarView.setMaxDate(1485302400000L); calendarView.setMinDate(1485475200000L); calendarView.setMaxDate(1485648000000L); 

Maybe you should use third-party libraries?

    1 answer 1

    You have come from the wrong side. Calendar is not a View user interface element. This is a Java class used for working with dates (more details here ), which allows, for example, setting separate components for a single date (year, day, hour, etc.)

    To display the calendar on the screen, use CalendarView (documentation here ). However, I am afraid, it will not help you much, as it is used to select a date.

    If you want to write your multifunctional calendar, you will have to create it from scratch from another View or modify an existing one.