This will be displayed in a mono-spaced font. The first four spaces will be stripped off, but all other white space will be preserved.
String letterStr = null;
letterStr = (String)((TextView)view).getText();
the String
contains html markups, and android treats it as a Spannable
.
You can either assign the return value of getText()
to a CharSequence object, which super class for both String
and Spannable
, or replace the cast with toString()
letterStr = ((TextView)view).getText().toString();
the former will preserve the html markups, the latter will not
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