@Override public void removeContactQueryListener(ContactQueryListener l) { super.removeContactQueryListener(l); contactQueryListenersCount--; if (contactQueryListenersCount == 0) { clearListeners(); } }
@Override public void addContactQueryListener(ContactQueryListener l) { super.addContactQueryListener(l); contactQueryListenersCount++; if (contactQueryListenersCount == 1) { initListeners(); } }
/** * If query has status changed to cancel, let's clear listeners. * * @param status {@link ContactQuery#QUERY_CANCELED}, {@link ContactQuery#QUERY_COMPLETED} */ public void setStatus(int status) { if (status == QUERY_CANCELED) clearListeners(); super.setStatus(status); }
/** * Cancels this <tt>ContactQuery</tt>. * * @see ContactQuery#cancel() */ public void cancel() { clearListeners(); super.cancel(); }