So, my question restated is when you go to Settings -> Accounts & Sync and select the an account that was created that your SyncAdapter
is syncing with a cloud server, and select remove account, what happens as far as your SyncAdapter
is concerned? There is a dialog that displays asking you to confirm and that the data on the phone associated with that account will be removed. I cannot easily believe that the framework can automatically remove the data my SyncAdapter
has stored in the local database, but it seems to imply that removing the account will (and I would agree that is should) remove that data. Is there a addition to my SyncAdapter
that will serve sort of as the callback for the account removal to handle deleting all the appropriate data from the local database? Maybe it has to be done through the AccountManager
instead; my AccountManager
gets notified when the account gets removed and from there I can trigger the data deletion without the SyncAdapter
.
EDIT:
On a related note, is the sync manager calling my SyncAdapter
for each account that it synchronizes when a new account is added? I see a onPerformSync(...)
being executed for previously added accounts along with the just added account when I add an account, and would like to stop that.
onCreate
are you talking about? – Yaron