Does SyncAdapter get notified when AccountManager removes account?

后端 未结 3 1588
心在旅途
心在旅途 2020-12-30 14:46

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 c

3条回答
  •  心在旅途
    2020-12-30 15:10

    Another option is to register for the android.accounts.LOGIN_ACCOUNTS_CHANGED broadcast that the AccountManager sends out. Unfortunately, this broadcast is sent out whenever any account is changed and the broadcast does not deliver further information what has changed either.

    So you'd have to query the account manager and look how many of "your" accounts it has left and delete the data of the missing ones.

提交回复
热议问题