SyncAdapter not being called depending on order of Account setup calls

后端 未结 2 1123
忘了有多久
忘了有多久 2021-01-08 00:47

I\'ve come across some slightly odd behaviour with my SyncAdapter.

The first time I install my app (after uninstalling with adb), it launches and creates an account

2条回答
  •  忘掉有多难
    2021-01-08 01:19

    I found that contentResolver.requestSync() will never trigger your SyncAdapter.onPerformSync() unless you call ContentResolver.setIsSyncable(account, getString(R.string.CONTENT_AUTHORITY), 1);.

    For a detailed account of the solution I went with using SyncAdapter, see my answer here:

    https://stackoverflow.com/a/12015967/988870

提交回复
热议问题