1
我有下面的類:Android Studio中報告日期錯誤
public class ModelCalendarDay {
private int year;
private int month;
private int day;
// ......
}
我有這樣的方法:
public Date getDate() {
GregorianCalendar thatDay = (GregorianCalendar) GregorianCalendar.getInstance();
thatDay.set(year, (month - 1), day, 0, 0, 0);
return thatDay.getTime();
}
雖然我仍然可以啓動應用程序,Android Studio中抱怨的(month - 1)
位:Must be one of Calendar.January, Calendar.February, etc
這怎麼解決?