I am getting [OBJ] displayed on the screen when I try to set a ImageSpan on a text View..it shows a /uFFFC unicode character instead of the image on the screen,i.e. a dotted box with OBJ written inside it.
To apply a span, call setSpan(Object _what_, int _start_, int _end_, int _flags_) on a Spannable object. The what parameter refers to the span to apply to the text, while the start and end parameters indicate the portion of the text to which to apply the span.
String a = tv. getText(). toString(); int A = Integer. parseInt(a);
SetText(String, TextView+BufferType)Sets the text to be displayed using a string resource identifier.
I faced the same problem, thus I just wanted to have the HTML stripped and just get the String
.
The solution is probably not the most beautiful one, but still pretty pragmatical:
public CharSequence stripHtml(String s) {
return Html.fromHtml(s).toString().replace('\n', (char) 32)
.replace((char) 160, (char) 32).replace((char) 65532, (char) 32).trim();
}
This [OBJ] character seemed to be (char) 65532
.
I had to display a very ugly RSS item's (HTML) description field in a TextView
without formats. The hypertext contained a lot of WYSIWYG debris like <p></p><p></p>
…
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With