示例#1
0
  public void setOAuthTokenWithSecret(
      String oAuthToken, String oAuthSecret, boolean cancelPending) {

    if (oAuthToken == null && mCurrentOAuthToken == null) {
      return;
    } else if (oAuthToken != null
        && mCurrentOAuthToken != null
        && oAuthToken.equals(mCurrentOAuthToken) == true) {
      return;
    } else if (oAuthSecret != null
        && mCurrentOAuthSecret != null
        && oAuthSecret.equals(mCurrentOAuthSecret) == true) {
      return;
    }

    if (cancelPending == true) {
      mFetchBooleans.clearCallbacks();
      mFetchLists.clearCallbacks();
      mFetchDirectMessages.clearCallbacks();
      mFetchStatus.clearCallbacks();
      mFetchStatuses.clearCallbacks();
      mFetchUser.clearCallbacks();
      mFetchUsers.clearCallbacks();
      mModifyStatuses.clearCallbacks();
    }

    mCurrentOAuthToken = oAuthToken;
    mCurrentOAuthSecret = oAuthSecret;

    clearApiInstance();
    getAndConfigureApiInstance();
  }
示例#2
0
 public void getFriendshipExists(
     String userScreenName,
     String userScreenNameToCheck,
     TwitterFetchBooleans.FinishedCallback callback) {
   mFetchBooleans.getFriendshipExists(
       userScreenName, userScreenNameToCheck, callback, mConnectionStatus);
 }
示例#3
0
  private void initFetchBooleans() {
    mFetchBooleans = new TwitterFetchBooleans();

    FetchBooleansWorkerCallbacks callbacks =
        new FetchBooleansWorkerCallbacks() {

          public Twitter getTwitterInstance() {
            return SocialNetApi.this.getAndConfigureApiInstance();
          }

          public AppdotnetApi getAppdotnetInstance() {
            return SocialNetApi.this.getAppdotnetApi();
          }
        };

    mFetchBooleans.setWorkerCallbacks(callbacks);
  }