Hi all,

I'm having a problem trying to delete a contact from my Android device.
 When I delete the contact by using the following code:

    ArrayList<ContentProviderOperation> ops =
newArrayList<ContentProviderOperation>();


 ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.
CONTENT_URI)

                         .withSelection(ContactsContract.Data.CONTACT_ID +
"=?",

                           new String[]{id})

                         .build());

 try {

 mApp.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);

 } catch (RemoteException e) {

 Log.e(LOG_TAG, e.getMessage(), e);

 } catch (OperationApplicationException e) {

 Log.e(LOG_TAG, e.getMessage(), e);

 }

or:

        int result = mApp.getContentResolver().delete(ContactsContract.Data.
CONTENT_URI,

     ContactsContract.Data.CONTACT_ID + " = ?",

     new String[] {id});

The contact seems to be replaced by one called "(Unknown)".  Does anyone
know why this is the case and if there is anything I can do so that the
contact is deleted cleanly and I don't seen "(Unknown)" in the contact app
anymore?

Thanks...

Simon Mac Donald
http://hi.im/simonmacdonald

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to