一般同步设置"自动同步"复选框programtically复选框、QUOT、programtically

2023-09-06 14:59:21 作者:男人,最重要的是独宠一女.

我要寻找一种方式来启用/禁用自动同步复选框,在常规同步设置。

AFAIR股票功率控制部件有这个功能了。如果这个小工具可以做,应该有我一个解决方案也一样,对不对?请你们帮我了,我拼命寻找在网络上的解决方案,但没有成功。

难道一个用户交互是强制执行此操作?我知道我可以发送一个Intent打开同步查看但这不是我的本意!

我不是在寻找特定帐户的同步设置,因为我发现在这个论坛上像

  ContentResolver.setSyncAutomatically(客户账户,串权威,布尔同步);
 

解决方案   

我要寻找一种方式来启用/禁用自动同步复选框,在常规同步设置。

更新

尝试 setMasterSyncAutomatically() ContentResolver的

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

如何使windows开机时自动同步服务器时间

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);

解决方案

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

UPDATE

Try setMasterSyncAutomatically() on ContentResolver.