Public classConfig {Private StaticFinal String Token_key ="token"; Private StaticFinal String app_id ="Com.jiangcun.secret"; Public StaticString Getcachetoken (context context) {returnContext.getsharedpreferences (app_id, context.mode_private). getString (Token_key,NULL); } Public Static voidCachetoken (Context context,string token) {sharedpreferences.editor Editor=context.getsharedpreferences (app_id,context.mode_append). Edit (); Editor.putstring (Token_key,token); Editor.commit (); }}
Public classConfig {
private static FinalStringToken_key="token";
private static FinalStringapp_id="Com.jiangcun.secret";
Public StaticString Getcachetoken (Context context) {
returnContext.getsharedpreferences (app_id, Context.mode_private). GetString (Token_key,NULL);
}
Public static voidCachetoken (Context context,string token) {
Sharedpreferences.editor Editor = context.getsharedpreferences (app_id, Context.Mode_append). Edit ();
Editor.putstring (Token_key, token);
Editor.commit ();
}
}
App Token Config