@Override public void onTaskFinish(TaskResponse<NetworkResponse> response) { waitDialog.dismiss(); InterResult result = TranslateTaskResponse.getResponse(InterResult.class, response); if (result.getCode() == 200) { WDSharedPreferencesUtil.getInstance().saveProperty("user_pwd", ""); ToastManager.getInstance().showToast(this, "密码修改成功"); finish(); } else { ToastManager.getInstance().showToast(this, result.getErrMsg()); } }
public void doLogin() { String oldPwd = old_Pwd.getText().toString(); String newPwd = new_pwd.getText().toString(); String sureChange = sure_pwd.getText().toString(); if (!newPwd.equals(sureChange)) { ToastManager.getInstance().showToast(this, "两次密码不一致,请重新输入"); } else { waitDialog.show(); Map<String, String> body = new HashMap<String, String>(); body.put("userId", WDSharedPreferencesUtil.getInstance().getString("userId")); body.put("oldPwd", oldPwd); body.put("newPwd", newPwd); ExecutableTask task = new ExecutableTask.Builder() .setTask(new HttpTask(NetConstant.I_ChangePwd, body)) .setExecutor(new HttpTaskExecutor()) .setCallBack(this) .builder() .setTag(tag); WaterDropsTaskManager.getInstance().pushToTaskQueue(task); } }
@Override public void onTaskError(WaterDropsError error) { waitDialog.dismiss(); ToastManager.getInstance().showToast(this, error.getMessage()); }