Ejemplo n.º 1
0
    @Override
    protected void onPostExecute(FetchUserTaskOutput output) {

      FinishedCallback callback = getFetchStatusesCallback(output.mCallbackHandle);
      if (callback != null) {
        callback.finished(output.mFetchResult, output.mUser);
        removeFetchStatusesCallback(callback);
      }

      super.onPostExecute(output);
    }
    @Override
    protected void onPostExecute(ModifyStatusesTaskOutput output) {

      FinishedCallback callback = getModifyStatusesCallback(output.mCallbackHandle);
      if (callback != null) {
        callback.finished(output.mResult.mErrorMessage == null, output.mFeed, output.mValue);
        removeModifyStatusesCallback(callback);
      }

      super.onPostExecute(output);
    }
Ejemplo n.º 3
0
  public void verifyUser(FinishedCallback callback, ConnectionStatus connectionStatus) {

    if (connectionStatus != null && !connectionStatus.isOnline()) {
      if (callback != null) {
        callback.finished(
            new TwitterFetchResult(false, connectionStatus.getErrorMessageNoConnection()), null);
      }
      return;
    }

    mFinishedCallbackMap.put(mFetchUserCallbackHandle, callback);
    new FetchUserTask()
        .execute(
            AsyncTaskEx.PRIORITY_HIGH,
            "Validate User",
            new FetchUserTaskInput(mFetchUserCallbackHandle, connectionStatus));
    mFetchUserCallbackHandle += 1;
  }
Ejemplo n.º 4
0
  private void trigger(Long userId, FinishedCallback callback, ConnectionStatus connectionStatus) {

    if (connectionStatus != null && !connectionStatus.isOnline()) {
      if (callback != null) {
        callback.finished(
            new TwitterFetchResult(false, connectionStatus.getErrorMessageNoConnection()), null);
      }
      return;
    }

    assert (!mFinishedCallbackMap.containsValue(callback));

    mFinishedCallbackMap.put(mFetchUserCallbackHandle, callback);
    new FetchUserTask()
        .execute(
            AsyncTaskEx.PRIORITY_HIGH,
            "Fetch User",
            new FetchUserTaskInput(userId, mFetchUserCallbackHandle, connectionStatus));

    mFetchUserCallbackHandle += 1;
  }