SharedPreferences sp;
sp = getSharedPreferences("userInfo", Context.MODE_PRIVATE);
//放值
Editor editor = sp.edit();
editor.putBoolean("isrem", true);
editor.putBoolean("isauto", true);
editor.putString("username", username_et.getText().toString());
editor.putString("password", password_et.getText().toString());
editor.commit();
//取值
sp.getBoolean("isrem", false);
username_et.setText(sp.getString("username", ""));
password_et.setText(sp.getString("password", ""));
Android 记住密码和自动登录
猜你喜欢
转载自blog.csdn.net/lvxiaobo1994/article/details/81032534
今日推荐
周排行