I have used syncadapter to periodically send data to the server. I am calling it when the application starts using the following piece of code
ContentResolver.addPeriodicSync(
mAccount,
AUTHORITY,
bundleParams,
SYNC_INTERVAL);
ContentResolver.setSyncAutomatically(mAccount, AUTHORITY, true);
ContentResolver.setMasterSyncAutomatically(true);
Now I want to change the SYNC_INTERVAL and make aggressive periodic syncs when it enters a certain activity. I wanted to know how do I change the sync time and restore it when it comes out of the activity? I tried removing the periodicsync using removePeriodicSync(...), and then adding a sync with different timer. But the sync still runs at the same time interval as previous one.