Показать строку в формате HTML

Мне нужен пример того, как отобразить строки, которые я разметил с помощью простого HTML в TextView. Я нашел "Spanned fromHtml (String source)", но я не знаю, как подключить его к моему Java-коду.

Вот моя Java:

package com.SorenWinslow.TriumphHistory;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class TriumphHistory extends ListActivity {
    String[] HistoryList;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ArrayAdapter<String> adapter;
        HistoryList = getResources().getStringArray(R.array.history);
        adapter = new ArrayAdapter<String> (this,R.layout.historylistlayout,HistoryList);
        setListAdapter(adapter);

    }
}

Вот образец истории:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="history">
<item><b>1883</b><br/>Some stuff happened</item>
<item><b>1884</b><br/>Some more stuff happened <i>before</i> the other stuff
</item>
<resources>

Вот мой historylistlayout.xml:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:textColor="#ffffff"
    android:background="#000050"
    android:layout_marginTop="5px"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:padding="3px" 
    android:textSize="8pt" android:layout_gravity="top|left"/>

А вот и мой main.xml

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:textColor="#ffffff"
    android:background="#000080" 
    android:isScrollContainer="true" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" android:scrollbarStyle="insideOverlay">

  <ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:clickable="true" 
    android:dividerHeight="1px"/>

</LinearLayout>

Ответы на вопрос(5)

Ваш ответ на вопрос