Questions tagged [toast]

A toast notification is a transient message to the user that contains relevant, time-sensitive information and provides quick access to related content in an app.

A toast notification is a small informational popup window in a GUI, used to notify the user of an event or status change. The user cannot interact with a toast notification, which fades away after a short amount of time. The term was allegedly coined during the development of MSN Messenger because the notification windows slid up from the bottom of the screen, like toast popping up from a toaster.

Within stackoverflow, the tag most often refers to the Android class android.widget.Toast. For more information, see Creating Toast Notifications.

2068 questions
31
votes
8 answers

How to cancel Toast

I developed an android application and I am facing a problem with Toast. Suppose I am displaying a Toast, it is displayed on the application window. When a Dialog box is appears, the toast doesn't disappear instantly . I want to know how I can…
Dev.Sinto
  • 6,802
  • 8
  • 36
  • 54
31
votes
8 answers

Button in custom Android Toast?

Is it possible to have a button in a Toast? In theory, yes because you can build a custom Toast from a layout in XML, but I tried to put a button in it and couldn't get it to register the click. Did anyone manage to do something like that?
Sephy
  • 50,022
  • 30
  • 123
  • 131
30
votes
9 answers

How to prevent Multiple Toast Overlaps

I've been using a common "myToast" which I use "myToast.cancel() prior to issuing a new toast. For Android v2.3 and older, this works great. When a new toast needs to be sent, the old one, if still on-screen, is canceled (and disappears immediately)…
Frank
  • 605
  • 1
  • 8
  • 14
28
votes
8 answers

How to set Toast display time less than Toast.LENGTH_SHORT

I want to display toast less than Toast.LENGTH_SHORT, as i feel its taking around 2 seconds. i want to display toast only for half second. And what is time interval for Toast.LENGTH_SHORT and Toast.LENGTH_LONG ?
Zoombie
  • 3,590
  • 5
  • 33
  • 40
27
votes
6 answers

How to initialize toasts with JavaScript in Bootstrap 5?

I can't initialize Bootstrap 5 Toasts. The button to initialize the toast: My JavaScript: document.getElementById("toastbtn").onclick = function() { var…
randomdude
  • 369
  • 1
  • 3
  • 13
27
votes
6 answers

How to raise a toast in AsyncTask, I am prompted to used the Looper

I have tasks completed by AsyncTask in background. At some point I need to issue a Toast that something is completed. I've tried and I failed because Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called…
Pentium10
  • 204,586
  • 122
  • 423
  • 502
26
votes
3 answers

Toast message from Broadcast Receiver

I have a broadcast receiver and I am trying to show a toast message from it, is this possible ? This code doesn't show the toast but it print the log message in the logcat. Is there some idiotic thing I am doing or what is my problem…
Lukap
  • 31,523
  • 64
  • 157
  • 244
26
votes
3 answers

Can i have an example of displaying a toast using runOnUiThread.

I searched many places but could not find a complete working example of implementation of "runOnUiThread". I tried a lot , but getting lots of errors . I just want to display a toast from a thread.
Sourav301
  • 1,259
  • 1
  • 14
  • 24
23
votes
6 answers

Change Toast Font

Currently, I'm trying to develop an app. and I don't know how to change the Toast font. . final OnClickListener clickListener = new OnClickListener() { public void onClick(View v) { try { …
Ye Lin Aung
  • 11,234
  • 8
  • 45
  • 51
23
votes
12 answers

How can I show a toast for a specific duration?

This is the way I have to show the Toast for 500 milliseconds. Though, it's showing more than a second. Toast.makeText(LiveChat.this, "Typing", 500).show(); How can I show Toast only for 500 milliseconds?
MuraliGanesan
  • 3,233
  • 2
  • 16
  • 22
22
votes
2 answers

onPageFinished() never called (webview)!

I want to show a toast when the webview is totally loaded. But the toast never show up, i don't know why..here is my code: public class WebViewSignUp extends Activity{ WebView mWebView; @Override public void onCreate(Bundle…
user420574
  • 1,437
  • 5
  • 21
  • 33
22
votes
7 answers

How to use Toast when I cant use "this" as context

I have a location listener activity and I want to make toast notifications. But it will not let me pass this as the context. How should I make toast work?
Seth Hikari
  • 2,711
  • 6
  • 27
  • 32
22
votes
7 answers

android - calling ui thread from worker thread

Hi I want to make Toast available to me no-matter-what and available from any thread whenever I like within my application. So to do this I extended the Activity class: import android.app.Activity; import android.os.Bundle; import…
conners
  • 1,420
  • 4
  • 18
  • 28
20
votes
11 answers

Styling ionic 2 toast

Is there any way to style the text message within an ionic 2 toast? I have tried this: let toast = Toast.create({ message: "Some text on one line.

Some text on another line.", duration: 15000, showCloseButton:…
Bill Noble
  • 6,466
  • 19
  • 74
  • 133
20
votes
4 answers

Value always return 0 where it should return number of row inserted

I have two table, one is Information and the other is WorkForce Information WorkForce The twf column in WorkForce is used to get the id of Information, which suppose return as 1, but it return value 0. If the id in Information is 5, twf should be…
John Joe
  • 12,412
  • 16
  • 70
  • 135