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 7684405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:00:54+00:00 2026-05-31T19:00:54+00:00

I am setting following string as a input for my txtMessage : protected void

  • 0

I am setting following string as a input for my txtMessage :

protected void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.breaknotification);

    TextView txtMessage = (TextView)findViewById(R.id.txtMessage);
    String msg = "TIME   RECORD        VALUE\n" +
                 "10 AM    1            20\n"+
                 "11 AM    2            30\n"+
                 "12 PM    3            40";

    txtMessage.setText(msg);

}

my breaknotification.xml file is as per following:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

<TextView
    android:id="@+id/txtMessage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dp"
    android:text=""
    android:textColor="#FFFFFF"
    android:textSize="21sp"
    android:textStyle="bold" />

</LinearLayout>

and I want to print my string as per following format.

TIME   RECORD     VALUE
10 AM     1        20
11 AM     2        30
12 PM     3        40

But it is not showing me exactly what I want; it shows me following in my message,

TIME     RECORD      VALUE
`10 AM    1       20`
`11 AM    2       30`
`12 PM    3       40`

So how can I achieve it?

  • 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-05-31T19:00:55+00:00Added an answer on May 31, 2026 at 7:00 pm

    I found the following solution :
    added textView property : android:typeface=”monospace”

    <TextView
      android:id="@+id/txtMessage"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginLeft="5dp"
      android:text=""
      android:textColor="#FFFFFF"
      android:typeface="monospace"
      android:textSize="21sp"
      android:textStyle="bold" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input string in the following format: 12.34 When I call this
I have the following input data in String: Hello #this# is #sample# text. It
I created the following method for retrieving stored settings from the database: public String
I am using following setting for customErrors in my web.config. <customErrors mode="On" defaultRedirect="GenericErrorPage.aspx" >
If I have the following setting in my app.config file. It is a setting
I am creating a DynamicMultiMock as follows: this.serviceClient = this.mocks.DynamicMultiMock<ISlippyPlateProcedureService>(typeof(ICommunicationObject)); Then setting the following
I use the following URL setting to authorize Facebook login. But the page for
I am having a problem setting up the following in Visual Studio 2008: a
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
I have following this blog in setting Xvfb in my ubuntu environment: http://corpocrat.com/2008/08/19/how-to-install-xvfb-x11-server-in-linux-server/ So

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.