i have a DateApapter class like this..
public class DateAdapter extends BaseAdapter
{
...
}
i call this DateApapter in 12 different places from my "mainActivity" by using constructor
and store this result in a DateApapter object "mDefaultAdapter " like this..
mDefaultAdapter = new DateAdapter(this,days,sysDate,disablePastDays, selectedDateTypeDf);
and stored this various results of mDefaultAdapter in ArrayList like this..
ArrayList<DateAdapter> mDefaultAdapterList = new ArrayList<DateAdapter>();
mDefaultAdapterList.add(mDefaultAdapter);
now coming to the problem,
- In my 1st call DateAdapter constructor , it returns January month details and I add this result(January) to ArrayList its works fine. Now the ArrayList has one Item, that is January details.
- but when i call 2nd result(February) to arrayList its overwrite 1st result also. Now the ArrayList has two Items, both of the items are February details.
- That means Last result of DateAdapter is filled the whole ArrayList. Finally i got December details only from ArrayList.
Why DateAdapter results are overwrite in previous ArrayList Items? I am not using any Static variables or methods in whole program. Please help me to fix this problem. Thanks..