1

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>
rvanrees
  • 25
  • 1
  • 7

2 Answers2

2

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

Viswanath Kumar Sandu
  • 2,230
  • 2
  • 17
  • 34
0

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

<uses-permission android:name="android.permission.INTERNET" />
Sven Affeld
  • 311
  • 3
  • 8