Reputation: 53
What could be the issue if ContentResolver.addPeriodicSync is not triggering onPerformSync(...) method.
But ContentResolver.requestSync is triggering onPerformSync(...)
More Info: onPerformSync - just creates a notification. And here is the code:
ContentResolver.requestSync(mAccount, AUTHORITY, settingsBundle);
ContentResolver.addPeriodicSync(
ACCOUNT,
AUTHORITY,
null,
SYNC_INTERVAL);
Upvotes: 1
Views: 1872
Reputation: 5899
You must call ContentResolver.setSyncAutomatically with true as the third (sync) parameter to enable syncing for your adaptor.
Also, Bundle
can't be null. Use new Bundle()
instead if you have no extras.
See here
Upvotes: 2