SharedPreferences 保存零散数据 用户名密码

来源:互联网 发布:jersey json 传递对象 编辑:程序博客网 时间:2024/06/05 11:26

//使用SharedPreferences来保存用户名密码
//路径在data/data/com.—-.—-/share
SharedPreferences sp = getSharedPreferences(“info”,MODE_PEIVATE);
//拿到sp的编辑器
Editor ed = sp.edit();
ed.putString(“name”,name);
ed.putString(“pass”,pass);
//提交
ed.comite();

0 0
原创粉丝点击