Wednesday, February 29, 2012

Is it possible to turn on synch in Android Account


I'm working on an application that will allow a user to turn on/off synching for their exchange email account.



I am able to get the exchange account using:




Account[] accs = AccountManager.get(this).getAccountsByType("com.htc.android.mail.eas");



but the Account API doesn't seem to offer what I'm looking for. I have also found ContactsContract.Settings database table which stores synch data, but I'm not that sure where to start with that.



Any ideas?

1 comment:

  1. The ContentResolver contains the API you are looking for.

    Check out the "setIsSyncable" method.

    ReplyDelete