i have a list of strings which is from a loop statement and i don't know how to make it an ArrayList then call the strings individually. here is the while statement :
try {
toDate=format.parse(str4);
java.util.Date newValue= new SimpleDateFormat(OLD_FORMAT).parse(str4);
String newValue2 = new SimpleDateFormat(NEW_FORMAT).format(newValue);
// System.out.println(newValue2);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//change the format of toDate
try {
newDateString=format.parse(str5);
java.util.Date newqwe = new SimpleDateFormat(OLD_FORMAT).parse(str5);
String newqwe2=new SimpleDateFormat (NEW_FORMAT).format(newqwe);
//System.out.println(newqwe2);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//get the days between two dates then print it
Calendar cal2 = Calendar.getInstance();
cal2.setTime(toDate);
while (cal2.getTime().before(newDateString)) {
cal2.add(Calendar.DATE, 1);
String datelist=(format.format(cal2.getTime()));
str4 is from a label which is a date same as str5, when a button is clicked the strings from the loop statement will be like this:
2013-05-03
2013-05-04
2013-05-05
2013-05-05
2013-05-06
2013-05-07
2013-05-08
2013-05-09
2013-05-10
2013-05-11
2013-05-12
2013-05-13
2013-05-14
2013-05-15
2013-05-16
2013-05-17