gpt4 book ai didi

android - 如何在android中编写清除电子邮件客户端设置的代码?

转载 作者:太空宇宙 更新时间:2023-11-03 11:15:39 25 4
gpt4 key购买 nike

enter image description here我正在此应用程序中处理与聊天相关的应用程序,将信息共享到电子邮件默认任何邮件客户端,它工作正常,在此应用程序中,我在设置中添加设置,一个选项是添加“清除电子邮件客户端设置”假设再次单击此显示对话框默认选择邮件选项。如何清除 android 中的电子邮件设置?请将任何解决方案发送给我。

Intent i = new Intent(Intent.ACTION_SEND); 
i.setType("text/html");
i.putExtra(Intent.EXTRA_SUBJECT, "Mail from Mobile Application");

String emailbody="";

emailbody=String.format("<html>"+
"<head>"+
"<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=2.0;'>"+
"</head>"+
"<body> " +
"<b>Reference : </b> %s"+"<br><br>" +
"</body>"+
"</html>",
s_ref);

i.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(emailbody));

try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}

最佳答案

我相信这不能再做了。自 Gingerbread 以来,Android 不向开发人员提供对名为 clearApplicationUserData(String packageName, learUserDataObserver mClearDataObserver) 的特定方法的访问。因此,如果没有任何非法黑客攻击,您将无法做到这一点。

Source

关于android - 如何在android中编写清除电子邮件客户端设置的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17161394/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com