I have a SyncAdapter that extends AbstractThreadedSyncAdapter.
I execute a timer task in onPerformSync method.
I want to check if the user turned off the Syncing so that I can stop the Timer Task.
I use ContentResolver.isSyncActive() method to check this issue.
the problem is that it always returns false.
so how can I check if Sync is turned on/off ??
Thanks
You want to call
ContentResolver.getMasterSyncAutomatically().That will give you the global setting, whereas
getSyncAutomaticallyjust checks whether an individual Account is enabled andisSyncActivesimply tells you whether a sync is happening at the moment.