Good day. There is a html-text displayed in the ListView
. listView
does not accept html tags and displays the text as is. Can you please tell me how to make the listView
display text with the tags? Thank.
I found this solution in the Internet:
ArrayAdapter<String> adapter= ArrayAdapter<String>(SearchByFood.this, R.layout.new_list_view, arr_sort){ public Object getItem(int position) { return Html.fromHtml(arr_sort.get(position)); } };
But then I have an Object
underscore and in the error log:
Error:(47, 27) error: getItem(int) cannot override getItem(int) in ArrayAdapter return type Object is not compatible with String where T is a type-variable: T extends Object declared in class ArrayAdapter
WebView
for displayingHTML
.ListView
This is not intended. - Vladyslav Matviienko