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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:37:30+00:00 2026-05-24T04:37:30+00:00

I am developing an application where I have to use numerous toasts. I display

  • 0

I am developing an application where I have to use numerous toasts.

I display these toasts by using:

Toast.makeText(context, "Some medium-sized text", Toast.LENGTH_SHORT).show();

The displayer toast, however, has the height of one line, while the text is displayed on multiple lines. The result is that I can’t view all the text in the toast.

How can I fix 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-05-24T04:37:31+00:00Added an answer on May 24, 2026 at 4:37 am

    Try inserting a carriage-return and line-feed where you want to split the text.

    These characters refer back to the old typewriter models. Carriage return was the cylinder moving back to the start and line feed was the cylinder rolling (feeding) by one line.

    In computing these are represented by two escaped characters (special codes that allow non-printable codes inside a string by prefixing them with a backslash \).

    • A carriage return is represented by \r
    • A line-feed is represented by \n (you can remember this as a new line).

    Some non-unix systems (e.g. Windows) require both, others (e.g Linux on which Android is based) only need the new line but it is generally safe to do both everywhere. The one thing that is essential is the order they are in. It must be \r\n

    To put this into your example:

    Toast.makeText(context, "First line of text\r\nSecond line of text", Toast.LENGTH_SHORT).show();
    

    In Android you should be able to reduce this to just the new line character \n as unix based systems are not so fussy:

    Toast.makeText(context, "First line of text\nSecond line of text", Toast.LENGTH_SHORT).show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im developing application for ios5.im using core data as data storage.i have to display
I am developing a Java Desktop Application but have some confusions in choosing a
I am developing an application using MVC Preview 5. I have used typed views.
I am a developing an iPad application in which i have to use CTRunDelegate
I am developing an iphone application which have a complicated view is to display
I'm developing an application which will have these classes: class Shortcut { public string
I am developing an application in which I have to use existing database but
I have been developing many application and have been into confusion about using dataset.
I'm developing Rails application and I have to use authentication. I installed devise gem
I am currently developing an application in Adobe Flex and i have to use

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.