Android SharedPreferences的应用

//定义
SharedPreferences share = getSharedPreferences("perference",MODE_PRIVATE);
//取值
String strBuyMall_value=share.getString("buymall_value","");
//赋值
Editor editor = share.edit();
editor.putString("buymall_value", strBuyMall_init);
editor.commit();//设置

 

你可能感兴趣的:(Android SharedPreferences的应用)