我正在开发一个以用户定义的频率同步所选帐户的 android 应用程序。
AccountManager manager = (AccountManager) getSystemService(ACCOUNT_SERVICE);
Account[] list = manager.getAccounts();
Pattern emailPattern = Patterns.EMAIL_ADDRESS;
for(i=0;i<AcntCount;i++)
for (Account account : list)
if (emailPattern.matcher(account.name).matches())
if(account.name.matches(syncSettings.getString("Account"+i.toString(), null)))
//ContentResolver.addPeriodicSync(account, authority, extras, pollFrequency)
应该在. authority
_ 我必须为此编写一个同步适配器吗?extras
addPeriodicSync()