V. Waves
V. Waves

Reputation: 31

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.

Upvotes: 3

Views: 1660

Answers (1)

Grumpy Cat
Grumpy Cat

Reputation: 1249

try this

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

Upvotes: 1

Related Questions