fragment中使用sharedPreferences保存数据。

来源:互联网 发布:人工智能学术会议 编辑:程序博客网 时间:2024/05/16 10:40
sp = this.getActivity().getSharedPreferences("config",
   Context.MODE_PRIVATE);

username = this.getActivity().getSharedPreferences("config", Context.MODE_PRIVATE).getString("fname", "");
  password = this.getActivity().getSharedPreferences("config", Context.MODE_PRIVATE).getString("fpass", "");
0 0
原创粉丝点击