Amit Rautela
Amit Rautela

Reputation: 36

Sharing text to WhatsApp having 2000 to 3000 characters in hindi font

I am trying to share a big text having a length of more than 3000 characters. However, I am unable to send all the text to WhatsApp.

My code shares only approximately 1000 characters to WhatsApp.

Here is the code:

Intent whatsappIntent = new Intent(Intent.ACTION_SEND);
whatsappIntent.setType("text/plain");
whatsappIntent.setPackage("com.whatsapp");
whatsappIntent.putExtra(Intent.EXTRA_TEXT,data);

Upvotes: 2

Views: 1651

Answers (2)

Anis Khan
Anis Khan

Reputation: 61

try{
        Uri uriUrl = Uri.parse("whatsapp://send?text="+text+""); 
        Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);  
        startActivity(launchBrowser);
    }
    catch(ActivityNotFoundException e){
        Toast.makeText(getActivity(), "Whatsapp Not Installed.", 2000).show();
    }

I was facing the same problem with Arabic text. Use this code. it worked for me.

Upvotes: 5

Batuhan Coşkun
Batuhan Coşkun

Reputation: 2969

We don't know which method you are using but there is 2 methods and there is not a character limitation for these 2 methods. You can read and learn much about these methods:

  1. WhatsApp FAQ - I'm an Android Developer, how can I integrate WhatsApp with my app?
  2. Android Developers page - Sending Simple Data to Other Apps

Good luck.

Upvotes: 0

Related Questions