//保存信息
SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE); //Context.MODE_PRIVATE 私有类型
Editor editor = sp.edit();
//保存数据
editor.putString("username", username);
editor.putString("password", password);
//提交
editor.commit();
//获取信息
SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
//获取数据
username_et.setText(sp.getString("username", ""));
password_et.setText(sp.getString("passwrd", ""));