コード例 #1
0
  private void callRefreshToken(final USUProgressDialog mProgressDialog) {
    PrintLog.debug("RefreshToken Called...");
    final RequestParams params = new RequestParams();
    params.put("refresh_token", userPreference.getRefreshToken().trim());

    getUsuApp()
        .getAsyncHttpClient()
        .loginHttpRequest(
            getActivity(),
            params,
            "refresh_token",
            new USUHttpClient.RequestListener() {
              @Override
              public void onComplete() {
                getMemberDetails(mProgressDialog);
              }

              @Override
              public void onExpired(int statusCode) {
                PrintLog.debug("DiscountFragments --> From LoginHttpRequest2");
                if (statusCode == 5000) {
                  callLoginScreen();
                }
              }

              @Override
              public void onError(String message) {
                if (mProgressDialog != null && mProgressDialog.isShowing()) {
                  mProgressDialog.dismiss();
                }
                AlertUtils.showAlert(getActivity(), message);
              }
            });
  }
コード例 #2
0
 private void callLoginScreen() {
   userPreference.setIsUserLoggedIn(false);
   startActivity(new Intent(getActivity(), LoginActivity.class));
   getActivity().finish();
 }