2014-09-19 87 views
0

每次我嘗試設置CalendarView今天的焦點(使用setDate()進行設置)時,它總是顯示日曆中可用的最後一天(2100年11月31日)。CalendarView無法將日期設置爲當前日期?

但是,如果我將日期設置爲另一天,它工作正常。

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

回答

2
CalendarView cal = new CalendarView(this); 
cal.setDate(System.currentTimeMillis(),false,true); 

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

這是什麼代碼,有一天在'CalendarView'類設置呢? – Squonk 2014-09-19 10:17:35

相關問題