This question is an exact duplicate of:
I am trying to save and retrieve information the user enters in a edit box and the selections made on check box. I have managed to get the edit box working but can't seem to figure out how to do it for the Check box.
This is for the Edit Box and it works fine to save the information.
editor.putString("saveName", name.getText().toString());
But thos doesn't. for the Checkbox editor.putBoolean("saveChoice1", choice1.isChecked());
This is for the Edit Box and it works fine to read the information. editor.putString("saveName", name.getText().toString());
But these don't... for the Spinner and Checkbox choice1.setSelected(sharedPref.getBoolean("saveChoice1", false));
I have spent a lot of time doing this and would really appreciate any help!
Aucun commentaire:
Enregistrer un commentaire