rvanrees
rvanrees

Reputation: 25

A <img> in a TextView with fromHtml

I want to load an image in a TextView with fromHtml

In the answer to this question a <img src="your_link"> should work in a TextView, but I only get a green square, see image below:

Result

This is the HTML that's loaded:

<!DOCTYPE html> 
<html>
<body> 
<h1>Image</h1> 
<img src="http://hanassets.nd.gov/images/product/test.png"> 
</body>
</html>

Upvotes: 1

Views: 181

Answers (2)

Viswanath Kumar Sandu
Viswanath Kumar Sandu

Reputation: 2274

Loading an image with is not possible using fromHtml() method. This method just helps you get the text styling from html

Upvotes: 2

Sven Affeld
Sven Affeld

Reputation: 341

It's a long shot, but did you add the permission in the android manifest?

<uses-permission android:name="android.permission.INTERNET" />

Upvotes: 0

Related Questions