You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say that there are the following duplicate contacts in the SIM card;
name: apple, number:123
name: apple, number:123
Then, attempting to delete both entries in one delete operation will result in the deletion of only one entry.
Executing the following code,
val simContacts =Contacts(context).sim().query().find()
Contacts(context).sim().delete().simContacts(simContacts).commit()
will result in the deletion of only one entry of name: apple, number: 123.
This is due to the internal SimContactToDelete not holding a reference to the unique row ID and internally using Set (removes duplicates) for keeping references to it AND the fact that the IccProvider will only delete one duplicate entry for each delete operation.
Solution
Nuke SimContactToDelete and just use SimContact, which does use the id.
The text was updated successfully, but these errors were encountered:
vestrel00
changed the title
Unable to delete duplicate SIM contacts in one delete operation
Unable to delete multiple duplicate SIM contacts in one delete operation
Sep 7, 2022
Problem
Let's say that there are the following duplicate contacts in the SIM card;
Then, attempting to delete both entries in one delete operation will result in the deletion of only one entry.
Executing the following code,
will result in the deletion of only one entry of
name: apple, number: 123
.This is due to the internal
SimContactToDelete
not holding a reference to the unique row ID and internally usingSet
(removes duplicates) for keeping references to it AND the fact that theIccProvider
will only delete one duplicate entry for each delete operation.Solution
Nuke
SimContactToDelete
and just useSimContact
, which does use theid
.The text was updated successfully, but these errors were encountered: