Android 3.0 CalendarView

I'm trying to implement CalendarView , an absurd amount of time appears on the screen (about 10 seconds), it loads only the headers of the month and week, it does not display calendar content.

Using the same code from this video , but not seeing the same result. I try to run it in a dialog box:

CalendarView calendarView = new CalendarView(this); dialog.setContentView(calendarView);

but when I tried to put it into action, it took the same amount of time to load and didn’t display correctly in the same way.

+8
android android-3.0-honeycomb android-ui calendarview
source share
1 answer

Tracing helped show that GregorianCalendar is called thousands of times. It seems that when the calendar days are not visible, he tries to calculate all the dates, not just the visible ones.

The problem with CalendarView displaying header information was resolved by setting explicitly layout_width and layout_height . None of wrap_content or match_parent worked correctly to display the contents of the calendar.

+17
source share

All Articles