android - How to Store and Access CheckBox value after activity closed and Open in Java? -


i making simple android project. when open app show dialog message. dialog have 1 check box function don't show again.

how this?

how save value on local , access it?

save value when checkbox checked

sharedpreferences prefs = preferencemanager.getdefaultsharedpreferences(getbasecontext()); prefs.edit().putboolean("checked",true).apply(); 

for validation

sharedpreferences prefs = preferencemanager.getdefaultsharedpreferences(getbasecontext()); boolean checked = prefs.getboolean("checked", false);  if (checked){     //do not show } else{  //show } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -