1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| protected void enregistrement(Context context)
{
SharedPreferences donees = context.getSharedPreferences(this.nom, Activity.MODE_PRIVATE);
SharedPreferences.Editor ecriture = donees.edit();
ecriture.putString("nom", this.nom);
ecriture.putString("type", this.type);
ecriture.putLong("date", this.date.getTimeInMillis());
ecriture.putBoolean("active", this.active);
ecriture.putLong("intervale", this.intervale);
ecriture.putBoolean("inexact", this.inexact);
ecriture.apply();
}
public void recupereration(Context context)
{
SharedPreferences donees = context.getSharedPreferences(this.nom, Activity.MODE_PRIVATE);
this.nom = donees.getString("nom", "faux nom");
this.type = donees.getString("type", this.type_defaut);
this.date.setTimeInMillis(donees.getLong("date", 0));
this.active = donees.getBoolean("active", this.active_defaut);
this.intervale = donees.getLong("intervale", this.interval_defaut);
this.inexact = donees.getBoolean("inexact", this.inexact_defaut);
} |
Partager