単一のテキストビューで曜日を表示する方法。
以下のようなコードがあります。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);
私の質問は、単一のテキストビューですべての週の日付を表示する方法です。上 textView.setText(string); 最後の日付のみを表示しますが、単一のテキストビューで週全体の日付が必要です。
ありがとう