0

我有一个页面,用户可以在其中看到邮件。在该页面中,我将菜单选项提供为“回复”,“回复全部”。当用户单击回复/回复全部时,我正在启动选择器对话框(用户可以在其中选择他使用的内置应用程序可以在回复时使用。现在当他选择任何应用程序时,现在我想获取我在该应用程序中配置的电子邮件 ID。

我们怎么能得到?任何想法。

4

1 回答 1

1
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Pattern emailPattern = Patterns.EMAIL_ADDRESS; 
Account[] accounts = AccountManager.get(context).getAccounts();
for (Account account : accounts) {
    if (emailPattern.matcher(account.name).matches()) {
        String possibleEmail = account.name;
    }
}
于 2012-11-14T13:36:54.040 回答