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?
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.
Use the "\n" tag in your strings:
new AlertDialog.Builder(this)
.setTitle("Place")
.setMessage("Go there" + "\n" +
"Go here")
.setNeutralButton("Go Back", null)
.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With