【发布时间】:2015-08-26 16:35:37
【问题描述】:
我正在尝试实现联系人同步适配器。当我从相应帐户下提供的同步选项进行同步操作时,它工作正常。但是,当我尝试在按钮单击时调用requestSync() 第一次 时,SyncAdapter 实现的onPerformSync() 函数调用并成功执行,但仍显示 Sync is Off 在相应帐户下同步设置。
我的按需运行同步适配器的代码是:
Bundle settingsBundle = new Bundle();
settingsBundle.putBoolean(
ContentResolver.SYNC_EXTRAS_MANUAL, true);
settingsBundle.putBoolean(
ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
/*
* Request the sync for the default account, authority, and
* manual sync settings
*/
ContentResolver.requestSync(mAccount, AUTHORITY, settingsBundle);
所以请指导我,有什么方法可以在运行 Sync Adapter On Demand 后打开 Sync Setting。
【问题讨论】:
标签: android android-contacts android-syncadapter