onPerformSync() is not triggered after ContentResolver.requestSync() call
- by mark
I am trying to implement sync adaptor, I have followed This guide.
But onPerformSync() is not triggered after ContentResolver.requestSync() call .
I have also tried some other tutorials and tried to run their code, but still same issue.
Please tell me does I need to do some extra configuration for this.
My code of triggering sync operation is as folows :
Account newAccount = new Account(GlobalInfo.ACCOUNT, GlobalInfo.ACCOUNT_TYPE);
AccountManager accountManager = (AccountManager) this.getSystemService(ACCOUNT_SERVICE);
accountManager.addAccountExplicitly(newAccount, null, null);
ContentResolver.requestSync(newAccount,GlobalInfo.AUTHORITY, Bundle.EMPTY);
Please guide me to solve this issue.
EDIT :
Accounted created (in Settings - Accounts and Sync settings) by above code showing sync is off