package com.saatcioglu.android.guessthenumber;
import android.content.Context;
import android.content.SharedPreferences;
public class ManagePreferences {
static final public String PREF_NAME = "GuesstheNumber.pref";
static final private String ELAPSED_TIME = "isDisplayElapsedTime";
static final private String TOTAL_SHOTS = "isDisplayTotalShots";
static final private String FLAG_LIST = "isDisplayFlagList";
static final private String PLAYER_NAME = "strNameofPlayer";
static final private String DIGIT_NUMBER = "nDigitNumber";
static final private String MAX_SHOTS = "nMaxShots";
static final private String MAX_TIME = "nMaxTime";
SharedPreferences sharedPreferences;
SharedPreferences.Editor editor;
ManagePreferences(Context context){
sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
editor = sharedPreferences.edit();
}
public void commit(){
editor.commit();
}
public void setArtist(String artist){
editor.putString(ELAPSED_TIME, artist);
}
public String getArtist(){
return sharedPreferences.getString(ELAPSED_TIME, "");
}
}
|