Example #1
0
  public void onGroupsLoaded(Account account, List<Group> groups) {
    mGroups.clear();

    if (null != groups) {
      mGroups.addAll(groups);
      if (null != mGroupsListener && mGroupsListener != this) {
        mGroupsListener.onGroupsLoaded(account, mGroups);
        mGroupsListener = null;
      }
    }
  }
Example #2
0
  public void getGroups(Context context, GroupsResultListener listener, boolean forceRefresh) {
    if (null == mGroups) {
      mGroups = new ArrayList<Group>();
    }

    if (forceRefresh || mGroups.isEmpty()) {
      mGroupsListener = listener;
      new GroupsAsyncTask(context, this, this).execute();
    } else {
      listener.onGroupsLoaded(this, mGroups);
    }
  }