private void removeMember(Member member) { // If the contact was just added during this session, remove it from the list of // members to add if (mListMembersToAdd.contains(member)) { mListMembersToAdd.remove(member); } else { // Otherwise this contact was already part of the existing list of contacts, // so we need to do a content provider deletion operation mListMembersToRemove.add(member); } // In either case, update the UI so the contact is no longer in the list of // members mListToDisplay.remove(member); mMemberListAdapter.notifyDataSetChanged(); // Update the autocomplete adapter so the contact can get suggested again mAutoCompleteAdapter.removeMember(member.getContactId()); }