Android AccountAuthenticator and synchronization service: display in the "Sync and data" section

I have an AccountAuthenticator and its associated SyncService that work when I test using Dev Tools -> Sync Tester on the emulator. I also have preferences that work on the Account screen.

However, I was not able to figure out how to get my synchronization service, indicated in the "Data and Sync" section of the account page. (There's a screenshot of this area below: http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/ )

So, for example, if I synchronized contacts, I would suggest that you have the option to set "Synchronize contacts." How to achieve this for my custom data model / sync service?

+3
source share
1 answer

Turns out I had to call:

ContentResolver.setIsSyncable(account, "authority.here", 1)
+2
source

Source: https://habr.com/ru/post/1785143/


All Articles