sharedPreferences存储的数据
- int Code
code
表示当前用户的类别:医生为1,用户为2.
- Sting user
user
存储当前user的json字符串
- String doctor
doctor
存储当前doctor的json字符串
- List
userList userList
存储登陆过的用户列表
- List
doctorList doctorList
存储登陆过的医生列表
sharedPreferences包含的方法
-
获取SharedPreferences对象
SharedPreferences getShared(Context context,String file) -
获取Edit
SharedPreferences.Editor getSharedEdit(Context context,String file) -
保存User
boolean saveUser(Context context, UserPatient userPatient) -
保存Doctor
boolean saveDoctor(Context context, UserDoctor userDoctor) -
判断User是否存在
boolean userExist(Context context) -
断Doctor是否存在
boolean doctorExist(Context context) -
删除User
boolean delUser(Context context) -
删除Doctor
boolean delDoctor(Context context) -
获取userList
List<UserPatient> userList(Context context) -
获取doctorList
List<UserDoctor> doctorList(Context context)