@Override public void onAttachedToWindow() { super.onAttachedToWindow(); mUserLogin = SharedPreferencesUtil.getInstance(this).getLoginUser(); if (mUserLogin == null) { Toast.makeText(this, "用户未登陆,不能使用密码修改功能,请先登陆", Toast.LENGTH_SHORT).show(); startActivity(new Intent(this, LoginActivity.class)); finish(); } }
@Override protected void onPostExecute(SimpleResponse simpleResponse) { if (simpleResponse != null) { if (simpleResponse.getCode() == SimpleResponse.SUCCESS) { Toast.makeText(UpdatePWDActivity.this, simpleResponse.getMessage(), Toast.LENGTH_SHORT) .show(); Intent intent = new Intent(UpdatePWDActivity.this, LoginActivity.class); if (mUserLogin != null) { intent.putExtra(Constants.Strings.USER_MOBILE, mUserLogin.getMobile()); } startActivity(intent); SharedPreferencesUtil.getInstance(UpdatePWDActivity.this).saveLoginUser(null); finish(); } } }