Creating a professional changelog using an AlertDialog (on Android in Java)

202 views Asked by At

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! ;)

2

There are 2 answers

1
fweigl On BEST ANSWER

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>
0
ceph3us On

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 />