Sorry if this is obvious to everyone else, but I have a little problem understanding how to display html inside my list.
My list has been announced.
ListView lv1 = (ListView) findViewById(R.id.ListView01);
I fill it (not shown) and then set my list here using the ArrayAdapter.
lv1.setAdapter(new ArrayAdapter<String>(SearchByFood.this, R.layout.new_list_view, foods));
Next, I create a new array of strings in which I want to have bold tags. Then I add this new array (called arr_sort) to the arrayadapter insdie a onTextChanged () method.
lv1.setAdapter(new ArrayAdapter<String>(SearchByFood.this, R.layout.new_list_view, arr_sort));
So now that my new array of strings has a <b> in it. How do I display bold text as a list?
Here is my new_list_view
<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" />
And here is my part of ListView in my main layout.
<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" > </ListView>
Any help would be greatly appreciated.
source share