我可以列出当前的星期日期。但是如何列出前一周/下一周的日期?
(我想用一个按钮来列出前一周和下一周的日子。每当我点击它会显示一周前/一周后)
Calendar cal = Calendar.getInstance(Locale.UK);
cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
daydate = new SimpleDateFormat("dd.MM.yyyy");
for (int i = 0; i < 7; i++) {
dates[i] = daydate.format(cal.getTime());
cal.add(Calendar.DAY_OF_WEEK, 1);
}