简体   繁体   English

如何(即,什么意图动作)启动电子邮件应用程序的设置电子邮件帐户活动(添加新的电子邮件帐户活动)

[英]How (i.e., what intent action) to start the set up email account activity (add new email account activity) of the email application

From within my app, I'd like to start the set up new email account activity of the Email App which looks like this: http://i.stack.imgur.com/BNYnj.png 在我的应用程序中,我想开始设置电子邮件应用程序的新电子邮件帐户活动,如下所示: http : //i.stack.imgur.com/BNYnj.png

I've looked at this http://source-android.frandroid.com/packages/apps/Email/AndroidManifest.xml 我已经看过这个http://source-android.frandroid.com/packages/apps/Email/AndroidManifest.xml

and tried to start the set up email activity: 并尝试开始设置电子邮件活动:

Intent intent = new Intent("com.android.email.CREATE_ACCOUNT");
startActivity(intent);

But I got an exception: E/AndroidRuntime(517): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.email.CREATE_ACCOUNT } 但我有一个例外:E / AndroidRuntime(517):android.content.ActivityNotFoundException:找不到用于处理Intent的活动{act = com.android.email.CREATE_ACCOUNT}

Anyone please help me? 有人帮我吗

Thanks so much, John 非常感谢,约翰

you could try using an explicit intent. 您可以尝试使用明确的意图。 instead of 代替

new Intent("com.android.email.CREATE_ACCOUNT")

use 采用

new Intent(context, com.android.email.activity.setup.AccountSetupBasics.class)

you may also want to look into the whole ACTION_ADD_ACCOUNT action string. 您可能还需要研究整个ACTION_ADD_ACCOUNT操作字符串。 it may do what you are looking for without having to use a SPECIFIC app. 它可能无需使用SPECIFIC应用即可满足您的需求。 for example, when an oem installs a different email app from the stock android one. 例如,当oem安装了与普通android应用不同的电子邮件应用时。 if it happens there won't be anything to handle either the explicity or implicit intent. 如果发生这种情况,将无法处理显式或隐式意图。

This works for from APIs 4.0+. 这适用于APIs 4.0+。

Intent intent = new Intent("com.android.email.CREATE_ACCOUNT");
intent.putExtra("FLOW_MODE", 0);
startActivity(intent);

Below works for from APIs 2.1+. 以下适用于API 2.1+。 Maybe also work for lower versions (not tested). 也许也适用于较低版本(未测试)。

Intent intent = new Intent();
intent.setClassName("com.android.email", "com.android.email.activity.setup.AccountSetupBasics");
intent.putExtra("FLOW_MODE", 0);
startActivity(intent);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 电子邮件意图返回活动 - Email intent back to activity 解决Intent_Send(电子邮件)后如何启动活动 - How to start Activity after Intent_Send (Email) is resolved 当我尝试通过ACTION_SEND发送电子邮件时,找不到用于处理意图的活动出了什么问题? - When I trying to send email via ACTION_SEND No Activity found to handle intent What's Wrong? 验证电子邮件后如何启动新活动(Firebase) - How to start new activity after get email verified (firebase) 为新活动设置特定的电子邮件ID - Set a particular email id for new activity 创建新的Firebase电子邮件密码用户帐户后,Firebase用户的显示名称不会在活动中显示吗? - Firebase user display name won't show on activity after creating new Firebase email password user account? 如何实施将电子邮件发送到操作设置为空的活动? - How do I implement send email to action settings empty activity? android Action_send intent如何知道一旦发送电子邮件以关闭当前活动? - android Action_send intent how to know once an email has been sent to close the current activity? 如何从电子邮件打开 android 应用程序活动? - How to open android application activity from a email? 如何在电子邮件活动中的“ to”文本区域上设置文本 - how to set text on “to” textarea in email activity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM