Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7820435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:17:11+00:00 2026-06-02T07:17:11+00:00

Button hoursButton = (Button) findViewById(R.id.hours); final AlertDialog.Builder openinghours = new AlertDialog.Builder(this); hoursButton.setOnClickListener(new View.OnClickListener() {

  • 0
    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:

enter image description here

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:17:19+00:00Added an answer on June 2, 2026 at 7:17 am

    If you have an xml-document for the dialog you could align the text using gravity.

    Further reading: Alert dialog aligning

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Button myButton = new Button(this); myButton.setText(Change View); myButton.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); myButton.setOnClickListener(new OnClickListener() { public
Button novice = (Button) findViewById(R.id.novice); novice.setOnClickListener(new OnClickListener(){ public void onClick(View v) { Intent nov
My button's onclick listener is as follows: button.setOnClickListener(new OnClickListener() { @Override public void onClick(View
button = new Button (this); button.setText(Insert values); tableLayout.addView(secondo); button.setOnClickListener(new OnClickListener(){ public void onClick(View arg0)
Code: button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // fileReader(); new xyz().execute(); }//
button.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ if(mp2.isPlaying()==true) {mp2.stop(); mp.start(); } else mp.start(); }
//About Button in the principal menu final Button button3 = (Button) findViewById(R.id.button3); button3.setOnClickListener( new
Button b1 = new Button(this); b1.setText(R.string.hello); RelativeLayout layout1 = (RelativeLayout) findViewById(R.id.top_menu); //android:layout_alignParentRight=true layout1.addView(b1); Is
I have this button cell in my CellTable ButtonCell reListCell = new ButtonCell(); reListColumn
public Button stb; static int cnt=0; public ArrayList<RadioButton> Butgrp1 = new ArrayList<RadioButton>(); Timer myt;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.