Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing Unicode text via Android Intent gets truncated on Whatsapp

I am sharing a unicode text from my App via Intent, so that user can choose to share text via Email, Whatsapp or any other app receiving text/plain.

Text received by Whatsapp gets truncated when text size is large (1000 char or more), however full text is received on Email and other apps.

I am sharing it as following, and have also tried Intent instead of ShareCompact but both works similar!

    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();

Is there any Max Limit on sharing text to Whatsapp or some known solution on how to share 1-2K unicode data to Whatsapp via Intent sharing.

like image 870
V. Waves Avatar asked Dec 08 '25 06:12

V. Waves


1 Answers

try this

Uri uriUrl = Uri.parse("whatsapp://send?text="+text+""); 
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);  
startActivity(launchBrowser);
like image 110
Grumpy Cat Avatar answered Dec 09 '25 20:12

Grumpy Cat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!