use Sharedpreference to determine if a string is modified
This address: Http://blog.csdn.net/caroline_wendy
Determine whether the string is modified, you can store the string in the sharedpreference , to determine whether two times is the same;
private void Modifyname (final String name) {Emptyweboperationcallback callback = new Emptyweboperationcallback (this) {@Override public void operationexecutedsuccess (Weboperation operation, weboperation.weboperationre Questresult data) {String Modifiedname = Preferenceutils.get (Getapplicationcontext (), Pref_modified_name, ""); LOG.D (Debug_wcl+tag, "name =" + Modifiedname); if (Name.equals (Modifiedname)) {Showtoast ("the nickname has not changed"); } nameview.settext (name); Preferenceutils.setpreference (Getapplicationcontext (), Pref_modified_name, Nameview.gettext (). toString ()); User.getuser (mytaskactivity.this). Setdisplayname (name); } }; Moduserinfooperation operation = new Moduserinfooperation (name, null, callback); Getscheduler (). Sendblockoperation (This, operation, GetString (R.string.mytask_modifying_name)); }
When the content is the same,
Prompt ToastThe nickname has not changed.
Android-use Sharedpreference to determine if a string is modified