This library provides several APIs that supports deleting custom data.
To help illustrate how custom data integrates with these update APIs, we’ll use the
Gender custom data.
For more info about custom data, read How do I integrate custom data?
Custom data, just like regular data kinds, are attached to a RawContact. They follow the same rules as regular data kinds.
For more info, read How do I learn more about the API entities?
For example, you are able to delete existing handle names and the gender of an existing RawContact,
mutableRawContact.removeHandleName(contactsApi, handleName) mutableRawContact.setGender(contactsApi, null)
There are also extensions that allow you to delete custom data of an existing RawContact via a Contact, which can be made up of one or more RawContacts,
mutableContact.removeHandleName(contactsApi, handleName) mutableContact.setGender(contactsApi, null)
Once you have removed custom data, you can perform the update operation on the RawContact to commit
your changes into the database using
You may also delete an entire Contact or RawContact using
ProfileDelete in order
delete all associated data.
All custom data are compatible with the
DataDelete API, which allows you to delete sets of
existing regular and custom data kinds.
For example, to delete a set of
val handleNames: List<MutableHandleName> val genders: List<MutableGender> val deleteResult = Contacts(this) .data() .delete() .data(handleNames + genders) .commit()
For more info, read How do I delete existing sets of data?