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();//提交保存修改
        }本文出自 “陪你度过漫长岁月” 博客,请务必保留此出处http://4774721.blog.51cto.com/4764721/1792284
android保存数据到本地 SharedPreferences
原文地址:http://4774721.blog.51cto.com/4764721/1792284