I am working with arrayList data.so I have 4 array list.I have 3 arraylist are fill with data one of as for temporery store arraylist as per selection. my code is below.
if(App.SubPosition==0){
if(custList.size()>0)
custList1=custList;
}
if(App.SubPosition==1){
if(custList.size()>0)
custList2=custList;
}
if(App.SubPosition==2){
if(custList.size()>0)
custList3=custList;
}
App.SubPosition = position;
String json = null;
//custList.clear();
Log.e("Log","custList1="+custList1.size());
Log.e("Log","custList2="+custList2.size());
Log.e("Log","custList3="+custList3.size());
Log.e("Log","custList3="+custList.size());
custList.clear();
Log.e("Log","custList1="+custList1.size());
Log.e("Log","custList2="+custList2.size());
Log.e("Log","custList3="+custList3.size());
Log.e("Log","custList3="+custList.size());
run above code it will display log as per below.
If I clear only custlist then it is also clear to custlist1 arraylist.
why is it happen?
Your answer would be appreciated