Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Display HTML in a ListView
    primarykey
    data
    text
    <p>Sorry if this is obvious to everyone else but I am having a minor difficulty understanding how to display html inside my listview. </p> <p>My list view is declared. </p> <pre><code>ListView lv1 = (ListView) findViewById(R.id.ListView01); </code></pre> <p>I populate it (not shown) then set my listview here with an ArrayAdapter. </p> <pre><code>lv1.setAdapter(new ArrayAdapter&lt;String&gt;(SearchByFood.this, R.layout.new_list_view, foods)); </code></pre> <p>Further down I create a new array of strings that I want to have bold tags in. I then add this new array (called arr_sort) to the arrayadapter insdie a onTextChanged() method. </p> <pre><code>lv1.setAdapter(new ArrayAdapter&lt;String&gt;(SearchByFood.this, R.layout.new_list_view, arr_sort)); </code></pre> <p>So now that my new Array of Strings has &lt; b > tags in it. How do I make my listview display the bold text?</p> <p>Here is my new_list_view</p> <pre><code> &lt;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:textColor="@color/grey2" android:textSize="20sp" android:gravity="center_vertical" android:paddingLeft="6dip" android:minHeight="40dip" /&gt; </code></pre> <p>And here is my ListView part in my main layout. </p> <pre><code> &lt;ListView android:id="@+id/ListView01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/rounded_corners_green" android:cacheColorHint="#00000000" android:divider="@color/green6" android:dividerHeight="1px" android:fastScrollEnabled="true" &gt; &lt;/ListView&gt; </code></pre> <p>Any help would be much appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload