阅读409 返回首页    go 阿里云 go 技术社区[云栖]


SharedPreferences





  private void saveAccount(String username, String password) {
		    SharedPreferences sp = this.getPreferences(this.MODE_PRIVATE); // 获得Preferences
			SharedPreferences.Editor editor = sp.edit(); // 获得Editor
			editor.putString("username", username); // 将用户名存入Preferences
			editor.putString("password", password); // 将密码存入Preferences
			editor.commit();
	   }
	  
	  private Map<String, String> getAccount(){
		  SharedPreferences sp = this.getPreferences(this.MODE_PRIVATE);
		  Map<String, String> m = new Map<String, String>();
		  m.put("username", sp.getString("username", ""));
		  m.put("password", sp.getString("password", ""));
	  }











最后更新:2017-04-03 12:54:29

  上一篇:go Vxworks 6.6系列下载地址
  下一篇:go VxWorks:添加自己组件到Tornado