commonsware cwac - Load HTML Content to android RichEditText -
i'm using cwac-richedit librar in project user write text in , app save user input html content
problem when want show saved content user, displays html content. tried :spanned description = html.fromhtml(stepcontent); rtxtstepdescription.settext(description);
and looks this
edited: user writes in edittext: app saves content html.tohtml(rtxtstepdescription.geteditabletext())
<p dir="rtl"><u>سلام</u><br> متن <i>آزمایشی</i> برای <b>سوال</b></p>
figured out. these html entities, see 1 convertor online here.
use apache stringescapeutils apache commons lang:
import org.apache.commons.lang.stringescapeutils; ... string withcharacters = stringescapeutils.unescapehtml(yourstring);
javadoc says:
unescapes string containing entity escapes string containing actual unicode characters corresponding escapes. supports html 4.0 entities.
for example, string "<français>"
become "<français>"
if entity unrecognized, left alone, , inserted verbatim result string. e.g. ">&zzzz;x"
become ">&zzzz;x"
.
as described in answer here
android commonsware-cwac
No comments:
Post a Comment