Question

I am new to the Android app development (in Java) and I am also new to stackoverflow, so this is my first post/question. :) Anyway, what I want, is, to create a more or less professional changelog using an AlertDialog. I wanted to set the message of it unsing strings. Ok, this worked well. But then it looked like this:

Text Text Text Text Text Text Text Text

But I want that it looks like this:

Text Text Text Text

Text Text

Text Text Text Text Text

For this I tried to add HTML tags to the string.xml file:<string name="About"><html><head>Text Text Text</head><body><b><p>Text Text Text Text Text Text </p></b></body></html></string> (Just trying out what possibly could work)

And this worked for me only with bold-tags and stuff but I just couldn't figure out, how I can do it that my changelog looks like about the second example.

Can you help me, pls?

I'm looking forward to your suggestions!

PS: Sorry for the bad examples but I can't add images yet! :( and Sorry for my not so good English but I hope you could understand me! ;)

Was it helpful?

Solution

Either use \n in your String for a newline. Or use the paragraph tag, but I don't know if it is recognized. Like

<p>Texttext</p><p>second line</p>

OTHER TIPS

u can use HTML as source eg. on .setText(String) / .append(String) via:

String fromHtml = Html.fromHtml("<u>html code</u>"))

for new line use escape char \n or in html < br />

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top