android保存数据到本地SharedPreferences
SharedPreferences sp = getSharedPreferences("atw",MODE_PRIVATE);//创建对象, String readstring = sp.getString("isFirst", "false");//默认false if (readstring.equals("false")){ SharedPreferences.Editor editor = sp.edit();//获取编辑对象 editor.putString("isFirst","true");//keyname是储存数据的键值名,同一个对象可以保存多个键值 editor.commit();//提交保存修改 }
文章标题:android保存数据到本地SharedPreferences
URL地址:http://scyanting.com/article/jeidpj.html