No need for setSyncAutomatically, this is only for network tickles

This commit is contained in:
Dominik Schürmann 2014-08-21 11:33:42 +02:00
parent f0ff8d2222
commit 0c1e65bc8b

View File

@ -115,9 +115,11 @@ public class KeychainApplication extends Application {
Account[] accounts = manager.getAccountsByType(Constants.ACCOUNT_TYPE); Account[] accounts = manager.getAccountsByType(Constants.ACCOUNT_TYPE);
if (accounts == null || accounts.length == 0) { if (accounts == null || accounts.length == 0) {
Account account = new Account(Constants.ACCOUNT_NAME, Constants.ACCOUNT_TYPE); Account account = new Account(Constants.ACCOUNT_NAME, Constants.ACCOUNT_TYPE);
manager.addAccountExplicitly(account, null, null); if (manager.addAccountExplicitly(account, null, null)) {
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1); ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true); } else {
Log.e(Constants.TAG, "Adding account failed!");
}
} }
} }