Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip image tag in html data in android?

Tags:

android

My data in db is stored in html format along with image tags in it. So when I am getting the data from database I am removing the html tags and setting it to textview. My problem is even after removing the html tags, there is a small square box displaying in the emulator indicating that there is some image. How can I remove those square box in emulator which is an indication of image in that html data? Help me regarding this...

Thanks in advance

My Code:

textView.setText(Html.fromHtml(htmlString));
like image 903
user1448108 Avatar asked Jun 24 '12 15:06

user1448108


1 Answers

You could do a regex replace <img.+?> on htmlString.

textView.setText(Html.fromHtml(htmlString.replaceAll("<img.+?>", "")));

Untested

like image 126
Ruel Avatar answered Sep 24 '22 22:09

Ruel