0

I have a list View with some clients. In this listView i click in a client and appear a contextMenu.

How i can get the id of the contact that this client have in contactscontract?????

  public boolean onContextItemSelected(MenuItem item){
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();

         ----> info.position (I get the position of the item click in the list) ok

         Get id of contact in contactsContract application
         ---->   info.id???
         ---->   cursorAdapter.getItemId(info.position))

I think that neither of this options works.....

Anyone can help i clarify this problem

Ricardo Filipe
  • 435
  • 4
  • 8
  • 24
  • I use `info.id` and it's fine. May be it depends on input cursor for your adapter. – Trung Nguyen Dec 18 '12 at 15:21
  • to remove a specific contact of a specific group i use this. You think that is correct?? The contact is not remove, and i don't know if is the id that is wrong or this code.... getContentResolver().delete(Data.CONTENT_URI, ContactsContract.CommonDataKinds.GroupMembership.CONTACT_ID + "= ?" + " and " + ContactsContract.CommonDataKinds.GroupMembership.GROUP_ROW_ID + " = ? ", new String[]{String.valueOf(id), String.valueOf(groupId)}); – Ricardo Filipe Dec 18 '12 at 15:30
  • and thanks by your reply Yul. :) – Ricardo Filipe Dec 18 '12 at 15:32

0 Answers0