0

My code returns the current month as a number, for instance, if the month is July, the code will display 7 (see image link). http://imgur.com/Rvf8QYp How do I print the months name against its number?

 public void showOnScreen() {


    date_today.setText(mYear + "Years" + mMonth + "Month");
    e00.setText("" + a[0][0]);
    e01.setText("" + a[0][1]);
    e02.setText("" + a[0][2]);
    e03.setText("" + a[0][3]);
    e04.setText("" + a[0][4]);
    e05.setText("" + a[0][5]);
    e06.setText("" + a[0][6]);

}
Prime
  • 4,081
  • 9
  • 47
  • 64
user2619496
  • 15
  • 1
  • 8

1 Answers1

1

Of the Java.util.Calendar class the method getDisplayName:

Calendar calendar = new Calendar();
String date_plaintext = calendar.getDisplayName(mMonth, Calendar.LONG, Locale.US);
date_today.setText(date_plaintext+ ", " + mYear);
RyPope
  • 2,645
  • 27
  • 51