Search code examples
androidandroid-contentprovider

Delete one single cell from ContactsContract-ContentProvider


Hi fellow android programmers,

I wan't my application to delete one single information from a contact and I don't mean one phonenumber or one adress, I actually mean like only the street from the adress or only the job_description from the organization. Technically I won't to delete one cell of one row in the Data-Table of the ContactsContract-ContentProvider.

I red the documentation twice, but they are only talking about whole rows when they describe the insert-, update-, delete-, query-Methods :(

Is anyone aware of how to delete one particular cell? Or am I supposed to update one row with one cell so to "" (empty string)? Or do I even need to read one whole row, set the one cell to "" (empty string) and update the whole row?

Cheers and thanks in advance Ali3n


Solution

  • Do not delete it.. try to update it..

    1) add your new value of particular column, like contentValues.put(STREET,"");

    2) update the table by using update method. and use a where condition where contact_id = ur id.

    PS:column names are not right.