0

I am trying to copy formatted (rich) text to ClipboardManager in the form of HTML tags. But, when I paste it to another app, it pastes HTML tags which is a expected behaviour.

How can I copy formatted text (with images) in ClipboardManager and when it is pasted to an app which supports rich text, it shows formatted text and when it is pasted to an app which support plain text, it shows plain text?

James Z
  • 12,209
  • 10
  • 24
  • 44
satish123
  • 541
  • 7
  • 25
  • You can try having a `ClipData` with two items, one for each MIME type. However, there is no guarantee that every app will honor your formatting request. – CommonsWare Jul 31 '17 at 15:37

1 Answers1

0
    ClipData clip = ClipData.newHtmlText("meta", content, htmlText);

It can help with formatted text.

satish123
  • 541
  • 7
  • 25