I put increment date of the calendar and add into arraylist, but when i loop them out, the date is all same.
Calendar a = Calendar.getInstance();
ArrayList<Calendar> b = new ArrayList<Calendar>();
for (int i=0; i<3; i++) {
a.add(Calendar.DATE, i>0 ? 1 : 0);
b.add(a);
}
for (int i=0; i<b.size(); i++){
Log.d("xxx", "test=" + b.get(i));
}
suppose i wan 10/11/2012, 11/11/2012, 12/11/2012
but it come out like 12/11/2012, 12/11/2012, 12/11/2012
Anyone know how to solve this?