How to delete a RAW contact in android 2.x without having the Aggregation contact ID

by Timo Prill » Wed, 21 Apr 2010 23:09:14 GMT


Sponsored Links
 hi

i am fighting against the 2.x contact api...

my problem is, i only have the RAW_CONTACT_ID of a contact.
i want to delete this raw contact programmatically.

i tried the following (even in a row):

            this.cr.delete(ContactsContract.Contacts.CONTENT_URI,
                    ContactsContract.Contacts.Data.RAW_CONTACT_ID + EQUALS
                            + rawContactID, null);

            this.cr.delete(ContactsContract.RawContacts.CONTENT_URI,
                    ContactsContract.RawContacts.CONTACT_ID + EQUALS
                            + rawContactID, null);

            this.cr.delete(ContactsContract.Data.CONTENT_URI,
                    ContactsContract.Data.RAW_CONTACT_ID + EQUALS
                            + rawContactID, null);

after these deletions, i see an empty contact called "(Unknown)" left in 
my Adress book.

this contact can not even be deleted via menu -> delete.

now my question is, how can i delete a contact without having the 
aggregation contact id?

did i miss some table to go through?
is my only chance to set the "deleted" flag for the raw_contact_id?
and: if i never sync with a sync-adapter afterwards, will my "deleted" 
contact remain in the database forever?


scratching my head..
cheers
timo...

--



Other Threads

1. Can't make Bluetooth SDIO device to work under Bluez

Hi

I try to make an SDIO BT device to work under Bluez, I can see that
the driver is registering into hci sub-system in its probe function.
But I dont"see" it from user space, I dont see a call to its open
function.
(I dont see any devices using hcitool)

Is there any thing more I need to add in order to make bluez work
under Android in addition to
BOARD_HAVE_BLUETOOTH := true
(to init.rc maybe)
?

Guy's please help,
Thx
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

2. Why won't it start here?

Is there any problem with launching a service via an Alarm's
BroadcastReceiver's onReceive? My service never has it's onCreate or
onStart method called.

My Alarm's receiver gets a wakelock, calls context.startService(new
Intent(context, FmiDaemon.class)); (context given via onRecieve
parameter),  waits 3 seconds, then releases the lock.

My service has 2 methods, onCreate and onStart. onCreate gets another
wakelock, the end of onStart releases the wakelock, and calls
"stopSelf". Both methods are supposed to send data to a log, but never
do since they're never called.


Where is the problem? Is that a bad "context" to use? Is onCreate and
onStart the wrong methods to implement?
--~--~---------~--~----~------------~-------~--~----~

3. Interfacing External GPS device onto Zoom II

4. peekService only returning null IBinder

5. extending parcelables

6. ADC2 Paid App Question

7. Email applications with multiple image attachments