Murat Kaya
Murat Kaya

Reputation: 193

How can I have a listview item that only has a webview in it?

I couldn't find any way to do it. I need a listview item that is just a webview. Any ideas on how i can do this?

Upvotes: 0

Views: 97

Answers (1)

Xaver Kapeller
Xaver Kapeller

Reputation: 49817

You should never do this. First it would be a ScrollView inside a ScrollView which can seriously mess with scrolling. And secondly the WebView is a huge object and requires a high amount of memory. You should never use a WebView inside a ListView as there could be many WebView instances around at the same time which will consume a high amount of memory therefore increasing load times and this will make the list scrolling sluggish and unresponsive.

You can display simple html content with a TextView, like this:

textView.setText(Html.fromHtml(htmlContent));

Upvotes: 2

Related Questions