CalendarView can not setdate to current day?

user3788868 picture user3788868 · Sep 19, 2014 · Viewed 7k times · Source

Every time I try to set CalendarView to focus today (use setDate() to set), it always shows the last day which is available in the Calendar (31 November 2100).

But if i set date to another day it's work fine.

CalendarView cal = new CalendarView(this);
cal.setDate(new Date().getTime(),false,true);

Answer

raja picture raja · Sep 19, 2014
CalendarView cal = new CalendarView(this);
cal.setDate(System.currentTimeMillis(),false,true);

or

cal.setDate(Calendar.getInstance().getTimeInMillis(),false,true);