Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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, there should be a solution for me too, right? Please guys help me out, I am desperately looking for a solution on the web with no success.

Is it possible that a user interaction is mandatory for this operation? I know I can send an Intent to open the Sync View but this is not my intention!

I am not looking for the sync settings for a specific account as I found in this forum like

ContentResolver.setSyncAutomatically(Account account, String authority, boolean sync);
like image 804
GZA Avatar asked Nov 04 '11 12:11

GZA


1 Answers

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

UPDATE

Try setMasterSyncAutomatically() on ContentResolver.

like image 134
CommonsWare Avatar answered Nov 03 '22 20:11

CommonsWare