Maintained state of list of checkboxes and radio button in android

I have a list of checkboxes and radio button which I am loading dynamically in the alert dialog as shown in below screenshots.

Alert dialog with multiple checkboxes and radio buttons

Now what I want is that, maintained the state (Checked or Unchecked) of each checkBox and radio button from the list when I opened and close alert dialog for the first time. so I can easily set checked or unchecked state after reopen the AlertDialog.

Any help would be appreciated.

Thanks in advance.