toxa_xa
toxa_xa

Reputation: 639

Sharing html text on Android via WhatsApp broken

Can't share html from my own android app via WhatsApp from latest WhatsApp update.

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType("text/html");
shareIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlText));
shareIntent.putExtra(Intent.EXTRA_HTML_TEXT, htmlText);

This opens intent chooser, WhatsApp is there. After selecting it asks to select contact to share, but "send" button does nothing.

BTW, sharing for "text/plain" still works fine. Any ideas?

Upvotes: 0

Views: 706

Answers (1)

toxa_xa
toxa_xa

Reputation: 639

changing

shareIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlText));

to

htmlIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlText).toString());

fixed issue.

Upvotes: 0

Related Questions