Reputation: 3281
Under the 'Accounts & Sync' settings graphical OS menu, there are listings of user-configured Google accounts.
Please could someone point me in the right direction to programmatically change the sync settings associated with one of these accounts?
Thanks
Upvotes: 3
Views: 6849
Reputation: 11419
ContentResolver.setSyncAutomatically(account, authority, true/false): sets whether or not the provider is synced when it receives a network tickle.
Upvotes: 1
Reputation: 1748
Maybe ContentResolver#setIsSyncable()
can do what you want.
Perhaps would be better to fire the android.provider.Settings.ACCOUNT_SYNC_SETTINGS intent with either the EXTRA_AUTHORITIES extra set to ["google.com"]
, or possibly put the extra named "account"
as the Account object you got from AccountManager. Then your user can turn their sync on or off for themselves.
Upvotes: 1
Reputation: 51992
Those settings use the new AccountManager
APIs. Here's some sample code that shows how to add a new account. I'd assume that you'd want to get the credentials of one of the existing accounts and simply modify the data.
Unfortunately, I haven't had a chance to try out those APIs yet.
Upvotes: 2