我正在编写一个应用程序以编程方式添加 IMAP/POP3 帐户。问题是,我无法在“帐户和同步设置”中显示它。
Account account = new Account(context);
account.se;
account.setDescription("acc added thr prog");
account.setAutomaticCheckIntervalMinutes(10);
account.setEmail("UserName@gmail.com");
account.setDraftsFolderName("Drafts");
account.setOutboxFolderName("OutBox");
account.setSentFolderName("Sent");
account.setTrashFolderName("Trash");
account.setName("Tester");
account.setNotifyNewMail(true);
account.setSenderUri(mContext,"smtp+ssl+://UserName%40gmail.com:Password@smtp.gmail.com");
mAccount.setStoreUri(mContext,"imap+ssl+://UserName%40gmail.com:Password@imap.gmail.com");
account.setDeletePolicy(10);
account.setVibrate(true);
mPrefer = Preferences.getPreferences(getInstrumentation().getContext());
account.save(mPrefer);
Object mInstrumenatation;
Email.setServicesEnabled(mInstrumenatation.getTargetContext());
谢谢。