Is it possible to make a dialog with content from a string defined in your OnCreate? Because the only way to define the content of the dialog, which I could find, is with text or a string defined in values/strings.xml like this:
builder.setMessage(R.string.dialog_fire_missiles)
I hope there is someone who can help me, please tell me if my question is clear enough.
use getString
method of Context
to get String from strings.xml:
builder.setMessage(Your_Activity.this.getString(R.string.dialog_fire_missiles))
Just use:
builder.setMessage("Your Message")
There are two setMessage() methods, one for accepting a CharSequence, and one for accepting an R.string.*.
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