I am using a checked ListView
in a dialog. I am able to get all the checked items ans store it like this:
builder.setMultiChoiceItems(arr, null,
new DialogInterface.OnMultiChoiceClickListener() {
// indexSelected contains the index of item (of which checkbox checked)
@Override
public void onClick(DialogInterface dialog, int indexSelected,
boolean isChecked) {
if (isChecked) {
brandNameIDMap.put(brandList.getItem(indexSelected).getProductID(), brandList.getItem(indexSelected).getProductName());
//Log.i("ID", "onClick: "+brandList.getItem(indexSelected).getProductID());
//seletedItems.add(indexSelected);
} else{
brandNameIDMap.remove(brandList.getItem(indexSelected).getProductID());
}
}
});
PROBLEM:
Now I want to reopen the Dialog
and the items that were selected previously needs to be selected automatically. How can I do this?