gpt4 book ai didi

java - 在共享 Intent android中设置字体

转载 作者:行者123 更新时间:2023-11-30 09:17:12 25 4
gpt4 key购买 nike

我很长一段时间以来一直在寻找解决方案。我想设置从我的应用程序共享到其他应用程序的文本的字体。

我不知道如何实现,字体在 .ttf 文件中。我正在使用以下代码,但它适用于纯文本。

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "<b>This is a message for you</b><br/>Hello");

mShareActionProvider.setShareIntent(intent);

请告诉我可能的选择。

谢谢,阿曼迪普

最佳答案

I want to set the font of the text shared from my app to other apps.

对不起,那是不可能的。

The below code I am using but it is for the plain text.

假设您传递的是 HTML 标签,您可能希望使用 text/html,而不是 text/plain

关于java - 在共享 Intent android中设置字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19066315/

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