Java – how to read interrupts in download text?
•
Java
I'm using last. Com listed in the "downloads" section of the API FM Java library When I call "getwikitext()" and set it as my textview, all data will be returned; However, the HTML format is incorrect The data is displayed as a large text instead of a separate paragraph To illustrate what I mean, here is a picture that returns the content, followed by a link to the artist page
Picture – http://i.imgur.com/ameTO.jpg
How should things be – http://www.last.fm/music/Bon +Iver
This is what I asked for artist information, but what am I missing about paragraph spacing? I searched a lot, but especially not much information I'm basically shooting in the dark, so I need some help
artistInfo = Artist.getInfo("Bon Iver",key); artistText = artistInfo.getWikiText(); info.setText(""); info.append(Html.fromHtml((artistText)));
Solution
A simple call to replaceall () is sufficient:
String artistText = artistInfo.getWikiText(); artistText = artistText.replaceAll("\n","<br />"); info.setText(Html.fromHtml(artistText));
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码