开发步骤:创建一个SharedPerferences接口对象,并使用其putString方法放入相关的公共数据将验证通过的注册账号写入到该文件中将数据进行提交给出客户提示 1 //Register_Activity.java 2 3 if (flag) { 4 ...
开发步骤:
- 创建一个SharedPerferences接口对象,并使用其putString方法放入相关的公共数据
- 将验证通过的注册账号写入到该文件中
- 将数据进行提交
- 给出客户提示
1 //Register_Activity.java 2 3 if (flag) { 4 SharedPreferences.Editor editor=getSharedPreferences("publicData",MODE_PRIVATE).edit();//创建一个SharedPerferences接口对象 5 editor.putString("account", txtRegAccount.getText().toString().trim());//使用SharedPerferences接口对象的putString方法放入相关的公共数据 6 editor.commit(); //将数据进行提交 7 Toast.makeText(getApplicationContext(), "新用户注册成功!",Toast.LENGTH_LONG).show(); //给出客户提示 8 9 Intent intent = getIntent();10 intent.setClass(Register_Activity.this, LoginActivity.class);11 startActivity(intent);12 }
原标题:注册界面设计及实现之(三)SharedPerferences实现数据暂存
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。