Exemplo n.º 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();
  }
Exemplo n.º 2
0
  private void initFetchLists() {
    mFetchLists = new TwitterFetchLists();

    FetchListsWorkerCallbacks callbacks =
        new FetchListsWorkerCallbacks() {

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

    mFetchLists.setWorkerCallbacks(callbacks);
  }
Exemplo n.º 3
0
 public TwitterLists getLists(String screenName, TwitterFetchLists.FinishedCallback callback) {
   TwitterLists cachedLists = mFetchLists.getLists(screenName, callback);
   return cachedLists;
 }
Exemplo n.º 4
0
 public TwitterLists getLists(String screenName) {
   TwitterLists cachedLists = mFetchLists.getLists(screenName, null);
   return cachedLists;
 }
Exemplo n.º 5
0
 public TwitterLists getLists(int userId, TwitterFetchLists.FinishedCallback callback) {
   TwitterLists cachedLists = mFetchLists.getLists(userId, callback);
   return cachedLists;
 }
Exemplo n.º 6
0
 public TwitterLists getLists(int userId) {
   TwitterLists cachedLists = mFetchLists.getLists(userId, null);
   return cachedLists;
 }