http://doublekj.blog.163.com/blog/static/14681847420118465327617/
通过wifMananger 得到wifiName :title
两种:通过title+string得到相应的xml文件,新建N个文件,每个只包含一个id
或者通过1个xml 和很多id
下面用N个xml文件新建, 应该没有一个的方法效率高
1.在OnClick里 ,即使更新的时候,在 连接按键按下后,新建 xml文件,
preference_xml_name="WifiPassWord"+title;
Log.e("preference_xml_name1", " "+preference_xml_name);
SharedPreferences preference = context.getSharedPreferences(preference_xml_name,Context.MODE_PRIVATE);
editpassword.setText(preference.getString("editpassword"," "));
editusername.setText(preference.getString("editusername", " "));
2.create里:
preference_xml_name="WifiPassWord"+title;
Log.e("preference_xml_name1", " "+preference_xml_name);
SharedPreferences preference = context.getSharedPreferences(preference_xml_name,Context.MODE_PRIVATE);
editpassword.setText(preference.getString("editpassword"," "));
editusername.setText(preference.getString("editusername", " "));