私はこの方法で実際の曜日の名前を持つ文字列を取得しようとしました:
Calendar c = Calendar.getInstance();
int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
if (c.get(Calendar.MONDAY) == dayOfWeek) weekDay = "monday";
else if (c.get(Calendar.TUESDAY) == dayOfWeek) weekDay = "tuesday";
else if (c.get(Calendar.WEDNESDAY) == dayOfWeek) weekDay = "wednesday";
else if (c.get(Calendar.THURSDAY) == dayOfWeek) weekDay = "thursday";
else if (c.get(Calendar.FRIDAY) == dayOfWeek) weekDay = "friday";
else if (c.get(Calendar.SATURDAY) == dayOfWeek) weekDay = "saturday";
else if (c.get(Calendar.SUNDAY) == dayOfWeek) weekDay = "sunday";
しかし、weekDay
常にnullのままであり、デバッガーdayOfWeek
が5であると言うので、実際には理由がわかりません。c.get(Calendar.THURSDAY)