I need name of day in week but dependent o actual date and date to future. For example I need name of day today, then name of day tomorrow, name of date +2 days etc I make this code but not working good. So is there any better way how I can in android get name of day?
public String getDay3Name() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
String[] days = new String[] { "SUNDAY","SUNDAY","SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" };
String day = days[calendar.get(Calendar.DAY_OF_WEEK)+1];
return day;
}
public String getDay4Name() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
String[] days = new String[] { "SUNDAY","SUNDAY","SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" };
String day = days[calendar.get(Calendar.DAY_OF_WEEK)+2];
return day;
}