@Override
 protected void onCancelled(String s) {
   super.onCancelled(s);
   progressFragment.dismissAllowingStateLoss();
   if (e != null)
     Toast.makeText(WriteWeiboActivity.this, e.getError(), Toast.LENGTH_SHORT).show();
 }
Beispiel #2
0
 @Override
 protected void onCancelled(DBResult dbResult) {
   super.onCancelled(dbResult);
   if (progressFragment != null) {
     progressFragment.dismissAllowingStateLoss();
   }
   if (e != null) Toast.makeText(OAuthActivity.this, e.getError(), Toast.LENGTH_SHORT).show();
   webView.loadUrl(getWeiboOAuthUrl());
 }
    @Override
    protected UserBean doInBackground(Void... params) {

      FriendshipsDao dao = new FriendshipsDao(GlobalContext.getInstance().getSpecialToken());
      if (!TextUtils.isEmpty(bean.getId())) {
        dao.setUid(bean.getId());
      } else {
        dao.setScreen_name(bean.getScreen_name());
      }
      try {
        return dao.followIt();
      } catch (WeiboException e) {
        AppLogger.e(e.getError());
        this.e = e;
        cancel(true);
        return null;
      }
    }
Beispiel #4
0
    @Override
    protected DBResult doInBackground(String... params) {

      String token = params[0];
      long expiresInSeconds = Long.valueOf(params[1]);

      try {
        UserBean user = new OAuthDao(token).getOAuthUserInfo();
        AccountBean account = new AccountBean();
        account.setAccess_token(token);
        account.setExpires_time(System.currentTimeMillis() + expiresInSeconds * 1000);
        account.setInfo(user);
        AppLogger.e("token expires in " + Utility.calcTokenExpiresInDays(account) + " days");
        return AccountDBTask.addOrUpdateAccount(account, false);
      } catch (WeiboException e) {
        AppLogger.e(e.getError());
        this.e = e;
        cancel(true);
        return null;
      }
    }
 @Override
 protected void onCancelled(String s) {
   super.onCancelled(s);
   if (e != null)
     Toast.makeText(BlackMagicActivity.this, e.getError(), Toast.LENGTH_SHORT).show();
 }