Exemple #1
0
  public void onAlbumsLoaded(Account account, List<Album> albums) {
    mAlbums.clear();

    if (null != albums) {
      mAlbums.addAll(albums);

      if (null != mAlbumsListener && mAlbumsListener != this) {
        mAlbumsListener.onAlbumsLoaded(account, mAlbums);
        mAlbumsListener = null;
      }
    }
  }
Exemple #2
0
  public void getAlbums(Context context, AlbumsResultListener listener, boolean forceRefresh) {
    if (null == mAlbums) {
      mAlbums = new ArrayList<Album>();
    }

    if (forceRefresh || mAlbums.isEmpty()) {
      mAlbumsListener = listener;
      new AlbumsAsyncTask(context, this, this).execute();
    } else {
      listener.onAlbumsLoaded(this, mAlbums);
    }
  }