Toggle On Auto-sync Progarammatically In Android
May be this question is asked about 2-4 year ago.Still m not satisfied.My problem is: 'how to turn on/off auto Sync Programmatically'.I dont want any specific data to synchronous.J
Solution 1:
I guess you are talking about gmail auto sync the email right ? One way is setMasterSyncAutomatically() (ContentResolver), applies to all the accounts (and providers). If you set this off/false you can disable all the syncs.
This is what we have from android documentation.
publicstatic void setMasterSyncAutomatically (boolean sync)
Added in API level 5
Sets the master auto-sync setting that applies to all the providers and accounts. If this isfalsethen the per-provider auto-sync setting is ignored.
This method requires the caller to hold the permission WRITE_SYNC_SETTINGS.
Parameters
sync the master auto-sync setting that applies to all the providers and accounts
Post a Comment for "Toggle On Auto-sync Progarammatically In Android"