List<String> list = new ArrayList<String>(); Calendar ca = Calendar.getInstance(Locale.CHINESE); int start = ca.getFirstDayOfWeek(); int end = ca.getMaximum(Calendar.DAY_OF_WEEK); for (int i = start; i <= end; i++) { ca.set(Calendar.DAY_OF_WEEK, i); String aString=ca.getTime().toString(); String dateString; if (aString.subSequence(8, 9).equals("0")) { dateString=aString.substring(9, 10); }else { dateString=aString.substring(8, 10); } list.add("" + dateString); } String da[] = list.toArray(new String[list.size()]); date1.setText(da[0]); date2.setText(da[1]); date3.setText(da[2]); date4.setText(da[3]); date5.setText(da[4]); date6.setText(da[5]); date7.setText(da[6]);
时间: 2024-10-09 15:31:07