Background
Sharedpreferences I think is the easiest to get started, stored in XML.
Code
Public class Share { publicstaticvoid saveinfo (Context context,string username, String password) { = context.getsharedpreferences ("config", context. mode_private); = Sp.edit (); Editor.putstring ("username", username); editor.putstring ("password", password); Editor.commit (); }}
The main thing is to open edit, then write the data, then commit.
Sharedpreferences sp = getsharedpreferences ("config", mode_private); = Sp.getstring ("username", ""); = sp.getstring ("Password", ""); Usernametext.settext (username); Passwordtext.settext (password);
The above is read data.
I'm the dividing line of the king of the Land Tiger.
Source code: HTTP://PAN.BAIDU.COM/S/1DD1QX01
Savefile_share.zip
Reprint Please specify source: http://www.cnblogs.com/yydcdut/p/3720656.html