@Override protected void onFinished() { super.onFinished(); ViewUtils.dismissProgressDialog(); accountTask = null; }
@Override protected void onSuccess(UnreadCount result) { super.onSuccess(result); // 通知消息 unreadCountNotifier.notinfyUnreadCount(AppContext.getUnreadCount()); sendUnreadBroadcast(); }
@Override protected void onPrepare() { super.onPrepare(); ViewUtils.createProgressDialog( getActivity(), getString(R.string.account_load_auth), AisenUtils.getProgressBarDrawable()) .show(); }
@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", ""); }
@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(); } }
@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]); } } }
@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(); } }
@Override protected void onProgressUpdate(Integer... values) { super.onProgressUpdate(values); if (getActivity() != null) ViewUtils.updateProgressDialog(getString(values[0])); }
@Override protected void onFinished() { super.onFinished(); ViewUtils.dismissProgressDialog(); }
@Override protected void onFailure(TaskException exception) { super.onFailure(exception); showMessage(exception.getMessage()); }
@Override protected void onFinished() { super.onFinished(); unreadTask = null; }