SharedPreferences简单使用

1.存

SharedPreferences sp = context.getSharedPreferences("mybound", Context.MODE_PRIVATE);
Editor editor = sp.edit();
editor.putString("serial_no", serial_no);
editor.commit();

2.取

SharedPreferences sp = = context.getSharedPreferences("mybound", Context.MODE_PRIVATE);

sp.getString("serial_no", "");

 

posted @ 2015-03-11 20:59  种花小哥  阅读(129)  评论(0编辑  收藏  举报