标签:reference har cache share context span color nbsp turn
public class Config { private static final String TOKEN_KEY = "token"; private static final String APP_ID = "com.jiangcun.secret"; public static String getCacheToken(Context context){ return context.getSharedPreferences(APP_ID , Context.MODE_PRIVATE).getString(TOKEN_KEY,null); } public static void cacheToken(Context context,String token){ SharedPreferences.Editor editor = context.getSharedPreferences(APP_ID,Context.MODE_APPEND).edit(); editor.putString(TOKEN_KEY,token); editor.commit(); } }
public class Config {
private static final String TOKEN_KEY = "token";
private static final String APP_ID = "com.jiangcun.secret";
public static String getCacheToken(Context context){
return context.getSharedPreferences(APP_ID , Context.MODE_PRIVATE).getString(TOKEN_KEY,null);
}
public static void cacheToken(Context context,String token){
SharedPreferences.Editor editor = context.getSharedPreferences(APP_ID,Context.MODE_APPEND).edit();
editor.putString(TOKEN_KEY,token);
editor.commit();
}
}
标签:reference har cache share context span color nbsp turn
原文地址:http://www.cnblogs.com/halo-yang/p/7362190.html