onPerformSync() is not triggered after ContentResolver.requestSync() call

Posted by mark on Stack Overflow See other posts from Stack Overflow or by mark
Published on 2014-06-06T08:53:13Z Indexed on 2014/06/06 9:25 UTC
Read the original article Hit count: 114

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

© Stack Overflow or respective owner

Related posts about android

Related posts about android-syncadapter