Skip to content

Instantly share code, notes, and snippets.

@pedrojoya
Last active January 28, 2016 19:51
Show Gist options
  • Save pedrojoya/5734942 to your computer and use it in GitHub Desktop.
Save pedrojoya/5734942 to your computer and use it in GitHub Desktop.
Entrada SharedPreferences
// SharedPreferences preferencias =
// getSharedPreferences("pref_apl", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferencias.edit();
editor.putString("nombre", nombre);
editor.putInt("total", total);
editor.apply();
// SharedPreferences preferencias =
// getSharedPreferences("pref_apl", Context.MODE_PRIVATE);
int total = preferencias.getInt("total", 0);
SharedPreferences preferencias =
getSharedPreferences("pref_apl", Context.MODE_PRIVATE);
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="nombre">Baldomero</string>
<int name="total" value="25" />
</map>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment