I have a TextView and when I call .setText(string), it displays the string exactly as it is.
For instance, if the string contains " ' " , ' will be displayed.
How can I fix this?
Looks like your outside source already does the convertion from ' to ' since regular single quote will be displayed just fine in a TextView. What you can to do in this case is:
yourTextView.setText(Html.fromHtml(stringSource));
where stringSource is your string that comes from outside source. This will take care of more than just the single quote character.
The single quote ' in java needs to be escaped using a backslash (\). You can find other characters that need to be escaped here.
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