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. DOM2String

Hi

Is anyone knew how convert DOM object to String in Android 1.5? I can build
own recursive function, but I prefer some JAR library or trick in Android. I
will be glad if you could help me.

Best regards.

-- 
===============================
Wojciech Topolski
wojciech.topol...@gmail.com
===============================

-- 

2. Froyo coming July 13th - are you ready?

As many of you may have heard, Froyo is coming to the Verizon Droid
starting July 13th. That means millions of devices will be running
Froyo. There are a couple of important changes that need to be made in
order to be "Froyo compliant," here's what I've found:

Store app on SD card

This is a really easy modification, just add:
android:installLocation="auto"
ro your manifest statement and build with level 8.

The important change, and this one seems to be a lot more difficult to
find, is it seems Froyo is a lot more picky on null tests. Be sure
your app tests values for null or you'll get the dreaded FC.

Another thing you should do at this time is update your launcher icon.
The new flat style should be used at this point, along with adding the
various resolutions. This also is easy, just add the correct drawable
directories and the associated icons:

drawable - default, works with 1.5
drawable-hdpi - for "high" resolution devices
drawable-mdpi - for "medium" resolution devices

See: http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
for full details on inco specs.

Anyone have other tips for Froyo compliance?

-- 

3. Object Relational Mapping --- Tiny ORM on GitWeb

4. Center MapView on new added GeoPoint in ItemizedOverlay

5. VOOT: Undangan Launch Kompas Apps for iPad

6. Delete SD card contents

7. Launch intent in background then bring to foreground?