How to delete a contact in android 2.1
- by Rishabh
Hi,
I have added one contact to android by following code.
ContentValues values = new ContentValues();
Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);
long rawContactId = ContentUris.parseId(rawContactUri);
values.clear();
values.put(Data.RAW_CONTACT_ID, rawContactId);
values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan");
getContentResolver().insert(Data.CONTENT_URI, values);
It shows up on emulator 2.1, but when i am going to delete it manually by "delete contact" option, its not deleteing from emulator.
If I edit some thing on it then only it deletes.
How can i directly delete it from menu ?
Thanks in advance...