Captn Buzz Captn Buzz - 5 months ago 25
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)
.setTitle("Place")
.setMessage("Go there" +
"Go here")
.setNeutralButton("Go Back", null)
.show();


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

Answer

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.