Transfer from http://blog.sina.com.cn/s/blog_a73687bc0101dsjj.html(i) Use of sharedpreferences1. Save information:Sharedpreferences userdetails = context.getsharedpreferences ("userinfo", context.mode_private); Editor edit = Userdetails.edit (); Edit.clear (); Edit.putstring ("Phone", Phoneedittext.gettext (). toString (). Trim ()); Edit.putstring ("Password", Passwordedittext.gettext (). toString (). Trim ()); Edit.commit ();2. Read the information:Sharedpreferences userdetails = context.getsharedpreferences ("userinfo", context.mode_private); String phone = userdetails.getstring ("Phone", ""); String Password = userdetails.getstring ("Password", "");p honeedittext.settext (phone);p Asswordedittext.settext ( password);Note: There is no encrypted storage in this password, it is best to encrypt storage in real application。
Android: Save application data such as user name password