I know it seems a dumb question that has should be already asked, but I did not found the question simply asked and answered.
My manifest has in first line:
<?xml version="1.0" encoding="utf-8"?>
If I have xml layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/text_target"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_blue_light"
android:layout_margin="10dp"
android:text="" />
</LinearLayout>
and java code :
TextView question = (TextView) findViewById(R.id.text_target);
String text = "Lorsqu'ils sont utilisés, les accents peuvent être un plus à apporter à leur texte.";
question.setText(question.setText(Html.fromHtml(text)));
It displays:
Do you know how to display accent?