本文地址: http://blog.csdn.net/caroline_wendy
private void modifyName(final String name) {
EmptyWebOperationCallback callback = new EmptyWebOperationCallback(this) {
@Override
public void operationExecutedSuccess(WebOperation operation, WebOperation.WebOperationRequestResult data) {
String modifiedName = PreferenceUtils.get(getApplicationContext(), PREF_MODIFIED_NAME, "");
Log.d(DEBUG_WCL+TAG, "name = " + modifiedName);
if (name.equals(modifiedName)) {
showToast("昵称未发生改变");
}
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));
}Android - 使用SharedPreference判断字符串是否修改
原文:http://blog.csdn.net/caroline_wendy/article/details/41819389