Reputation: 36
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
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
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:
Good luck.
Upvotes: 0