vinod
vinod

Reputation: 53

ContentResolver.requestSync is working but ContentResolver.addPeriodicSync is not working

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

Answers (1)

easycheese
easycheese

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

Related Questions