Button hoursButton = (Button) findViewById(R.id.hours);
final AlertDialog.Builder openinghours = new AlertDialog.Builder(this);
hoursButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openinghours.setTitle("Opening Hours");
openinghours.setMessage(
"\nMonday: CLOSED"
+ "\nTuesday: CLOSED"
+ "\nWednesday: 22:00 - 3:00"
+ "\nThursday: CLOSED"
+ "\nFriday: 22:00 - 3:00"
+ "\nSaturday: 22:00 - 3:00"
+ "\nSunday: CLOSED");
openinghours.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
The opening hours are displayed. I want the actual opening hours to be displayed in a neat straight line, this is how it displays:

i’m trying to space the string out so that it looks all in straight, formed line.
There must be a better way of doing this?
If you have an xml-document for the dialog you could align the text using gravity.
Further reading: Alert dialog aligning