android-intent - 通过 Intent 共享文本在 Whatsapp 上被截断
问题描述
我通过意图共享一些文本,以便用户可以发送到他们选择的任何生成的应用程序createChooser
但是,我意识到当文本大小很大(1000 个字符或更多)时,Whatsapp 接收到的文本会被截断,但是接收到全文在电子邮件和其他应用程序上。我发现的唯一解决方案只允许仅发送到whatsApp Intent.ACTION_VIEW
。
Uri uriUrl = Uri.parse("whatsapp://send?text="+text+"");
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(launchBrowser);
那不是我想要的,因为我仍然希望生成应用程序的选择。我该怎么办?
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra("Intent.EXTRA_TEXT, "TEXT");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "SUBJECT");
startActivity(Intent.createChooser(shareIntent, "Share..."));
解决方案
推荐阅读
- python - Resample() 为不存在的日期返回不正确的数字
- ssl - Cert-Manager 为 AKS 提供自己的 SSL 证书
- php - 将 PHP 脚本转换为 Unix 可执行文件
- javascript - 在 ngx-editor 中,单击按钮时如何在光标位置插入 html 块
- arrays - 角度循环遍历对象数组
- javascript - 抛出错误:Describe 不是函数。运行 Mocha 测试时出现此错误
- java - Java 编译器中是否有一个全局设置来禁用 String.formatted() 的弃用?
- php - 在函数php中启动类对象?
- python - plt.scatter(): ValueError 因为'c'参数
- angular - 将来自 ngx-translate 管道的翻译存储到变量中