gpt4 book ai didi

android - 在共享 gmail android 中用粗体在新行中写入数据

转载 作者:行者123 更新时间:2023-11-29 00:35:16 26 4
gpt4 key购买 nike

我想在与 gmail 共享数据时使用粗体和换行样式书写。我试过\n 或者你可以说但我无法得到结果我的代码在下面..

        Intent intent = new Intent(Intent.ACTION_SEND); 
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, emailAddressList);
intent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
intent.putExtra(Intent.EXTRA_TEXT, "<b>Hi this is test app</b> <br/> your first app is this");
startActivity(Intent.createChooser(intent, "Choice App t send email:"));

但它没有以粗体和换行显示

最佳答案

尝试下面的代码它工作正常 :) 我已经测试过

    Intent shareIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"+emailAddressList));
shareIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
shareIntent.putExtra(
Intent.EXTRA_TEXT,
Html.fromHtml(new StringBuilder()
.append("<p><b>Hi this is test app</b></p>")
.append("<small><p>Hi this is test app</small>")
.toString()));

startActivity(Intent.createChooser(shareIntent, "Choice App t send email:"));

关于android - 在共享 gmail android 中用粗体在新行中写入数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13026414/

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