我想编写一个应用程序,给定用户名和密码,它将(除其他外)在设备上配置交换电子邮件电子邮件帐户。可以通过Android API 来实现吗?如果是这样,通过什么班级?
在 3.0 之前的版本中,有一种通过额外传递用户名和密码来配置交换电子邮件的方法。
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);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)