使用AccountPicker.newChooseAccountIntent选择电子邮件 [英] Pick an email using AccountPicker.newChooseAccountIntent

查看:112
本文介绍了使用AccountPicker.newChooseAccountIntent选择电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让用户使用以下代码选择电子邮件帐户:

I'm trying to let the user pick an Email account using the following code:

Intent intent = AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"},
                            false, null, null, null, null);
                    startActivityForResult(intent, 23);

此代码效果很好,但是如果用户没有Gmail帐户,但Yahoo,Hotmail等,则可以使用. 如何通过更改第三个参数来显示所有电子邮件帐户:

This code works great but if the user doesn't have a Gmail account but Yahoo, Hotmail, etc.. How can I show all Email accounts by changing the third parameter:

new String[]{"com.google"}

非常感谢您

推荐答案

现在是2019年,该代码似乎不再起作用.要在选择器中显示所有帐户(使用Xamarin Android),而不是

It's 2019, and the code does not seem to work anymore. To get all accounts shown in the picker (using Xamarin Android), instead of

Android.Gms.Common.AccountPicker.NewChooseAccountIntent(null, null, 
null, false, null, null, null, null);

您必须使用

Android.Accounts.AccountManager.NewChooseAccountIntent(null,null,null,null,null,null,null)

这篇关于使用AccountPicker.newChooseAccountIntent选择电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆