Captn Buzz Captn Buzz - 1 year ago 48
Android Question

Displaying multiple lines of text in an Alert Dialogue

I need to display multiple lines of messages, rather than just one paragraph, in an alert dialogue.

new AlertDialog.Builder(this)
.setMessage("Go there" +
"Go here")
.setNeutralButton("Go Back", null)

Is there a way to start at new lines? Just like hitting enter after a sentence in Microsoft Word?


No guarantees on this, but usually to do multiple lines you do something like:

.setMessage("Go there\nGo here");

The "\n" is an escape character that means "New Line" I don't know about your specific case, but you can use it in just about everything AFAIK.