Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我通过设置/帐户屏幕选择复选框,我将运行自动同步。如果我将syncadapter.xml 中的UserVisible 设置为false,则无法选中该复选框。如何在没有设置屏幕选项的情况下启动自动同步。
要手动调用同步,您RequestSync至少需要使用您已经为SyncAdapter.
RequestSync
SyncAdapter
ContentResolver.RequestSync(account, authority, null);
这将使操作系统启动您注册的同步Service,从而启动您的SyncAdapter.
Service
回复:https://developer.android.com/reference/android/content/ContentResolver.html#requestSync(android.accounts.Account,%20java.lang.String,%20android.os.Bundle)