I think you need use a SharedPreferences vars... This methods only use for String values if you need to save int,floats, etc... you can create a different methods or just apply code when you need it. I think the best wayt is have in methods because you don't need to repeat code and to control values it's more easy... See the below code to know use sharedPreferences:
//Declaration of variables
//This var is name from file of shared preferences, you can save a different files for SharedPreferences
public String StartConfig_File = "sharedPref_StartConfig_File";
//And this one is a SharedPreference var from my StartConfig_File
public String userRemembered = "userRemembered";
//Method to get String from SharedPreference
public String Get_SharedPreferences(Context context, String sharedPref_File,String key_name){
//Declaration of variables
SharedPreferences sharedPref = context.getSharedPreferences(sharedPref_File, Context.MODE_PRIVATE);
String result = sharedPref.getString(key_name, null);
return result;
}
//Method to set String SharedPreference
public void Set_SharedPreferences(Context context,String sharedPref_File, String key_name,String key_value){
//Declaration of variables
SharedPreferences sharedPref = context.getSharedPreferences(sharedPref_File,Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(key_name,key_value);
editor.commit();
}
And below have a sample to call this methods:
//generalMethods is class where I have sharedPreferences methods! Change for your class...
//Initialize values from SharedPreference
generalMethods.Set_SharedPreferences(getActivity(),generalMethods.StartConfig_File,generalMethods.userRemembered ,"MyUser");
//Get value from SharedPreference
String result = generalMethods.Get_SharedPreferences(getActivity(), generalMethods.StartConfig_File, generalMethods.userRemembered );
This vars only disappear when app is uninstalled, you can get this values always if you have acces to context... Tell me if I helped you and good programming!