How to display RTF string in WebView (Android Studio)?

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

How can I display a RTF-String like this:

{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs21\f2\cf0 \cf0\ql{\fs30\f2 {\lang2055\b\ltrch Heading1}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\lang2055\ltrch Normal }{\lang2055\b\ltrch text }{\lang2055\i\ltrch as }{\lang2055\ul\ltrch RTF }{\lang2055\ltrch format.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\lang2055\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
}
}

I have tried
WebView.LoadData(rtfString, "text/rtf", "utf-8")
WebView.LoadData(rtfString, "application/rtf", "utf-8")
WebView.LoadData(rtfString, "text/richtext", "utf-8")
but could not find any result
 
I moved this to the Software Development forum, for more specific traffic.