How to build a syncadapter for the google calendar?

穿精又带淫゛_ 提交于 2019-12-04 20:03:44
  1. Use android.preference.PreferenceActivity to make your preference page.

  2. Ensure that your app updates the checkbox on the preference page with the value from the system before it opens. (The setting may have been changed in the Accounts & Sync system control panel.) Use ContentResolver.getSyncAutomatically(Account account, String authority) to read the system value

  3. Command the system to match the PreferenceActivity setting using ContentResolver.setSyncAutomatically(Account account, String authority, boolean sync) --

Note that you can't control sync on a provider -- you control it for an account/provider pair. Your app will need to keep a copy of the Account it is set to use so it can pass it in these calls.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!