I want some variables to be saved, when I shut down my app and to load them after opening the app (for statistics in a game)
How can I do this?
EDIT: Here my
sample code: save:
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = settings.edit();
editor.putString("statepara1", ts);
editor.commit();
get:
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
String ret = settings.getString("statepara1", "0");