I’m using LastFM API to get artists info. When I call their artist.getInfo method, I get a Artist object. However, the wiki summary text is formatted with html like this:
Arch Enemy is a Swedish <a href="http://www.last.fm/tag/melodic%20death%20metal" class="bbcode_tag" rel="tag">melodic death metal</a> band from Halmstad, Sweden, formed in 1996. Founded by <a href="http://www.last.fm/music/Carcass" class="bbcode_artist">Carcass</a> guitarist <a href="http://www.last.fm/music/Michael+Amott" class="bbcode_artist">Michael Amott</a> along with <a href="http://www.last.fm/music/Johan+Liiva" class="bbcode_artist">Johan Liiva</a>, both originally from the influential death metal band <a href="http://www.last.fm/music/Carnage" class="bbcode_artist">Carnage</a>. The band has released seven studio albums, a live album (Burning Japan Live 1999), two DVDs and three EPs. The band was originally fronted by Johan Liiva, who was replaced by <a href="http://www.last.fm/music/Angela+Gossow" class="bbcode_artist">Angela Gossow</a> as lead vocalist in 2000
I want to get plain text (html-less) from this text. I’ve tried removing them manually with substrings, but I can’t find the way to do it.
There is a class Html in Android. The simplest way to use this class, you can see method fromHtml(…), it returns Spannable which can be easily converted to plain text.
So the example would be next: