i have two activity with checkboxs in a list and i have to pass each value of checkbox to another activity and make it checked, where i can't use intent to pass that because both activity is not next together.
In this case how i will store the values in an array and to retrive in another activity
thanks to all, i have done it now and i'm posting it.
int i = 0;
checkBox = new CheckBox[getItemPR.size()];
Constants.INDEX_TEMP_NEW=new int[getItemPR.size()];// stoing in array[]
while (i < getItemPR.size()) {
ITEM dtItem = getItemPR.get(i);
TableLayout table11;
table11 = (TableLayout) LayoutInflater.from(this).inflate(
R.layout.itemoverview2, null);
checkBox[i] = (CheckBox) table11.findViewById(R.id.checkBox1);
checkBox[i].setId(i);
checkBox[i]
.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(
CompoundButton buttonView,
boolean isChecked) {
onSetcheckboxchanged(buttonView.getId());
}
});
if (Constants.INDEX_TEMP_NEW[i] == 0) {
checkBox[i].setChecked(true);
} else {
checkBox[i].setChecked(false);
}
and
public void onSetcheckboxchanged(int k) {
if (checkBox[k].isChecked()) {
Constants.INDEX_TEMP_NEW[k] = 0;
} else {
Constants.INDEX_TEMP_NEW[k] = 1;
}
}