Ejemplo n.º 1
0
    @Override
    protected void onFinished() {
      super.onFinished();

      ViewUtils.dismissProgressDialog();

      accountTask = null;
    }
Ejemplo n.º 2
0
    @Override
    protected void onSuccess(UnreadCount result) {
      super.onSuccess(result);

      // 通知消息
      unreadCountNotifier.notinfyUnreadCount(AppContext.getUnreadCount());

      sendUnreadBroadcast();
    }
Ejemplo n.º 3
0
    @Override
    protected void onPrepare() {
      super.onPrepare();

      ViewUtils.createProgressDialog(
              getActivity(),
              getString(R.string.account_load_auth),
              AisenUtils.getProgressBarDrawable())
          .show();
    }
Ejemplo n.º 4
0
    @Override
    protected void onSuccess(String s) {
      super.onSuccess(s);

      //            Logger.v(TAG, s);
      layInput.setVisibility(View.GONE);
      layWeb.setVisibility(View.VISIBLE);
      // 加载网页
      webView.loadDataWithBaseURL("https://api.weibo.com", s, "text/html", "UTF-8", "");
    }
Ejemplo n.º 5
0
    @Override
    protected void onSuccess(WeiBoUser result) {
      super.onSuccess(result);

      Logger.d(TAG, "授权成功");

      BaiduAnalyzeUtils.onEvent("add_account", "添加授权账号");

      showMessage(R.string.account_auth_success);

      if (getActivity() != null) {
        getActivity().finish();
      }
    }
Ejemplo n.º 6
0
    @Override
    protected void onSuccess(TokenInfo tokenInfo) {
      super.onSuccess(tokenInfo);

      // 同一登录账户
      if (tokenInfo != null
          && AppContext.isLoggedIn()
          && AppContext.getAccount().getUid().equals(tokenInfo.getUid())) {
        if (BaseActivity.getRunningActivity() != null
            && BaseActivity.getRunningActivity() instanceof MainActivity) {
          if (getParams()[0].getAccessToken().isExpired())
            requestLogin(BaseActivity.getRunningActivity(), getParams()[0]);
        }
      }
    }
Ejemplo n.º 7
0
    @Override
    protected void onFailure(TaskException exception) {
      super.onFailure(exception);

      if ("21324".equals(exception.getCode()) && getActivity() != null) {
        new AlertDialogWrapper.Builder(getActivity())
            .setTitle(R.string.remind)
            .setMessage(R.string.account_illegal_app)
            .setPositiveButton(
                R.string.confirm,
                new DialogInterface.OnClickListener() {

                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                    getActivity().finish();
                  }
                })
            .show();
      } else {
        showMessage(exception.getMessage());

        if (getActivity() != null) requestData();
      }
    }
Ejemplo n.º 8
0
    @Override
    protected void onProgressUpdate(Integer... values) {
      super.onProgressUpdate(values);

      if (getActivity() != null) ViewUtils.updateProgressDialog(getString(values[0]));
    }
Ejemplo n.º 9
0
    @Override
    protected void onFinished() {
      super.onFinished();

      ViewUtils.dismissProgressDialog();
    }
Ejemplo n.º 10
0
    @Override
    protected void onFailure(TaskException exception) {
      super.onFailure(exception);

      showMessage(exception.getMessage());
    }
Ejemplo n.º 11
0
    @Override
    protected void onFinished() {
      super.onFinished();

      unreadTask = null;
    }