如何在单个文本视图中显示星期几。
我有如下代码。在 logcat 中将星期日期显示为字符串。
Calendar c = Calendar.getInstance();
// Set the calendar to tuesday of the current week
c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
c.add(Calendar.DATE, week * 5);
c.add(Calendar.WEEK_OF_YEAR, week); //February
// Print dates of the current week starting on Monday
SimpleDateFormat df = new SimpleDateFormat("E dd yyyy", Locale.US);
for (int i = 0; i < 5; i++) {
//System.out.println(df.format(c.getTime()));
String string= df.format(c.getTime());
Log.d("", "MY YEAR OF MONTH=="+string); //[TUE 25 2014, WED 26 2014, THU 27 2014, FRI 28 2014, SAT 01 2014]
c.add(Calendar.DAY_OF_MONTH, 1);
//But this textview show only last date(sat 01 2014).
textView.setText(string);
我的问题是如何在单个 texview 中显示所有星期日期。以上 textView.setText(string); 只显示最后一个日期,但我想在单个文本视图中显示整个星期的日期。
谢谢