lundi 7 mai 2018

Android CheckBox State preservation not working

I have used android CheckBox and current state is checked when I rotate the screen checked state is changed to unchecked.

I have attached the code:

 CheckBox check = new CheckBox(this);
 check.Text = "CheckBox";
 linearLayout.AddView(check);

Please find the screen shot: Portrait:

enter image description here

Landscape:

enter image description here

How to restrict this? Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire