public void onEventsLoaded(Account account, List<Event> events) { mEvents.clear(); if (null != events) { mEvents.addAll(events); if (null != mEventsListener && mEventsListener != this) { mEventsListener.onEventsLoaded(account, mEvents); mEventsListener = null; } } }
public void getEvents(Context context, EventsResultListener listener, boolean forceRefresh) { if (null == mEvents) { mEvents = new ArrayList<Event>(); } if (forceRefresh || mEvents.isEmpty()) { mEventsListener = listener; new EventsAsyncTask(context, this, this).execute(); } else { listener.onEventsLoaded(this, mEvents); } }