protected void filterContacts(final String needle) { getListItems().clear(); for (final Account account : xmppConnectionService.getAccounts()) { if (account.getStatus() != Account.State.DISABLED) { for (final Contact contact : account.getRoster().getContacts()) { if (contact.showInRoster() && !filterContacts.contains(contact.getJid().toBareJid().toString()) && contact.match(needle)) { getListItems().add(contact); } } } } Collections.sort(getListItems()); getListItemAdapter().notifyDataSetChanged(); }