微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

通过Android API配置交换电子邮件帐户

我想编写一个应用程序,在给定用户名和密码的情况下,将(除其他外)在设备上配置交换电子邮件电子邮件帐户.可以通过Android API完成吗?如果是这样,通过什么课?

解决方法:

在3.0之前的版本中,有一种方法可以通过将UserName和Password作为附加内容传递来配置交换电子邮件.

ComponentName cname = new ComponentName("com.android.email", "com.android.email.activity.setup.AccountSetupBasics");
            Intent intent = new Intent("android.intent.action.MAIN");
            intent.putExtra("com.android.email.AccountSetupBasics.username", emailAddress);
            intent.putExtra("com.android.email.AccountSetupBasics.password", config.password);
            intent.putExtra("com.android.email.extra.eas_flow", true);
            intent.setComponent(cname);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐