/**
   * asynchronously load avatars
   *
   * @param avatarSize set a avatar size in one of 24*24, 32*32, 48*48, 64*64, 72*72, 96*96
   */
  public void loadAvatarUrls(int avatarSize) {
    List<Avatar> avatars;

    if (!Utils.isNetworkOn() || !avatarManager.isNeedToLoadNewAvatars()) {
      // Toast.makeText(AccountsActivity.this, getString(R.string.network_down),
      // Toast.LENGTH_SHORT).show();

      // use cached avatars
      avatars = avatarManager.getAvatarList();

      if (avatars == null) {
        return;
      }

      // set avatars url to adapter
      mAccountAdapter.setAvatars((ArrayList<Avatar>) avatars);

      // notify adapter data changed
      mAccountAdapter.notifyDataSetChanged();

      return;
    }

    LoadAvatarUrlsTask task = new LoadAvatarUrlsTask(avatarSize);

    ConcurrentAsyncTask.execute(task);
  }
    @Override
    protected void onPostExecute(Void v) {
      showLoading(false);
      if (err != null || accounts == null) {
        setErrorMessage(R.string.load_accounts_fail);
        if (err != null) {
          Log.d(DEBUG_TAG, "failed to load accounts: " + err.getMessage());
        }
        return;
      }

      if (accounts.size() == 1 && forwardIfOnlyOneAccount) {
        // Only 1 account. Go to next step.
        setAccount(accounts.get(0));
        chooseRepo();
        return;
      }

      CloudLibraryAccountAdapter adapter = getAccountAdapter();
      adapter.clear();
      for (Account account : accounts) {
        adapter.add(account);
      }
      adapter.notifyDataSetChanged();
      showListOrEmptyText(accounts.size());
    }