Skip to content Skip to sidebar Skip to footer

General Sync Settings "auto-sync" Checkbox Programmatically

I am looking for a way to enable/disable the 'auto-sync' checkbox in the 'general sync settings'. Afair the stock power control widget has this feature too. If this widget can do,

Solution 1:

I am looking for a way to enable/disable the "auto-sync" checkbox in the "general sync settings".

UPDATE

Try setMasterSyncAutomatically() on ContentResolver.


Solution 2:

ContentResolver.setMasterSyncAutomatically(true); // enables AutoSync

You should also add this

<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />

to your AndroidManifest.xml file.


Post a Comment for "General Sync Settings "auto-sync" Checkbox Programmatically"