android - 通过 Android Intent 共享 Unicode 文本在 Whatsapp 上被截断

标签 android android-intent whatsapp

我正在通过 Intent 从我的应用程序共享一个 unicode 文本,这样用户就可以选择通过电子邮件、Whatsapp 或任何其他接收文本/纯文本的应用程序来共享文本。

当文本较大(1000 个字符或更多)时,Whatsapp 接收的文本会被截断,但在电子邮件和其他应用程序中会收到全文。

我将其分享如下,并且还尝试了 Intent 而不是 ShareCompact,但两者的工作原理相似!

    StringBuilder sb = new StringBuilder()
            .append(service.getTite())
            .append(service.getTextBody())
            .append(service.getTranslations());

    ShareCompat.IntentBuilder.from(this)
            .setType("text/plain")
            .setText(sb.toString())
            .setSubject(service.getTite())
            .setChooserTitle(R.string.share_prompt)
            .startChooser();

与 Whatsapp 共享文本是否有任何最大限​​制或关于如何通过 Intent 共享将 1-2K unicode 数据共享到 Whatsapp 的一些已知解决方案。

最佳答案

试试这个

Uri uriUrl = Uri.parse("whatsapp://send?text="+text+""); 
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);  
startActivity(launchBrowser);

关于android - 通过 Android Intent 共享 Unicode 文本在 Whatsapp 上被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39141543/

相关文章:

android - 在Android中启动第三方应用程序的安装

php - 使用 WhatsApp 发送但未使用 WhatsApp 业务 API 发送给收件人的消息

iOS - 是否可以在 iOS 中以编程方式将 UIImage 与 WhatsApp 共享?

Android 应用程序在某些设备上强制关闭,但在其他设备上不会

Android 全屏应用程序 - 阻止访问状态栏

java - 位置服务 [访问] 启用监听器

ios - 如何通过我的应用程序在 whatsapp 上邀请用户并分享内容 IOS?

android - Universal Image Loader 重用图像

android - Android 中 Intent 过滤器响应所有 URL?

android - 将数据从类传递到 MainActivity