android-toast Questions
1
Solved
I have an Activity that does nothing but showing a Toast message like the following.
public MyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {...
Kennel asked 21/12, 2019 at 5:36
1
Solved
Let's say I have this code in onCreate()
for (int i = 0; i < 20; i++) {
Toast.makeText(MainActivity.this, "Toast "+i, Toast.LENGTH_SHORT).show();
}
when I launch the app, Toasts start to p...
Rush asked 25/10, 2019 at 10:33
3
My Toast have 3 lines, I want line 2 and 3 show center of this toast and set duration to 10 seconds.
How can do it?
Like this picture:
Sparkie asked 24/5, 2016 at 18:34
12
Solved
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 mi...
Dodgem asked 24/1, 2013 at 14:32
4
I just learned that I can use either:
Toast.makeText(MainActivity.this, R.string.some_string,Toast.LENGTH_SHORT).show();
or,
Toast.makeText(getApplicationContext(), R.string.some_string,Toast.L...
Cythiacyto asked 16/6, 2016 at 14:25
0
When calling show toast message from AIDL service callback toast comes with flicker. I tried with runOnUiThread(), handler, etc... in AIDL callback but still it's not solving.
Anyone faced simila...
Tyrosine asked 8/2, 2019 at 9:52
3
Solved
I'm following the example on android guide for bound service using messenger and running the following code snippet.
I've modified the snippet slightly to have a hi and a bye button and the servic...
Phosphoresce asked 18/9, 2014 at 13:43
1
Our goal is to show a toast when an incomming call happens. This won't work when the device is locked and an incomming call occures. Then the toast is visible behind the "locked fullscreen incommin...
Salesclerk asked 9/7, 2018 at 9:36
11
Solved
I was wondering if there was a way to display all text in a Toast to be centered. For instance, I have a Toast that has 2 lines of text in it. For purely aesthetic reasons, I would like the text to...
Skill asked 19/8, 2010 at 13:3
2
Solved
I'm having following error when I'm calling toast("Toast's message text") from Android Fragment:
java.lang.NoSuchMethodError: No virtual method getActivity()Landroid/app/Activity; in class Landr...
Subglacial asked 30/1, 2017 at 9:12
1
I am building out a media player for Android Auto and struggling to make a simple Toast Message that appears on the Automotive Display Head Unit.
In my Custom Actions, I have an action that needs ...
Lancelle asked 7/11, 2017 at 15:29
1
I've read a couple of discussions on when to use activity and when to use application context (e.g. on this SO post).
I'm wondering what the implications of using either activity or application co...
Subvert asked 13/10, 2017 at 13:8
2
Solved
I am testing an app with Espresso. I have one question is it possible to wait until there are no toast are currently being showed. I have a lot of different toast in my app, but while testing I hav...
Seagoing asked 13/8, 2015 at 20:52
1
I am getting a run-time exception on displaying a Toast message
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
I want to display the message ...
Deliadelian asked 18/1, 2017 at 20:47
3
Solved
I want to write a method that only takes certain values for a parameter, like f.e. in the Toast class in Android. You can only use Toast.LENGTH_SHORT or Toast.LENGTH_LONG as duration for the method...
Menashem asked 12/7, 2014 at 16:41
3
Solved
My android app displays several Toast messages. I recently installed it on a Galaxy S6, running Android 5.1.1 and noticed that the messages are displayed initially around the center of the screen, ...
Stagecoach asked 5/2, 2016 at 17:36
3
Solved
I'm trying to have my IntentService show a Toast message,
but when sending it from the onHandleIntent message, the toast shows but gets stuck and the screen and never leaved.
I'm guessing its becau...
Nutbrown asked 17/10, 2010 at 21:34
5
Solved
The Material design website mentions a new Toast-like element called a Snackbar: http://www.google.com/design/spec/components/snackbars-and-toasts.html
The Android L preview SDK documentation (sor...
Aspia asked 2/9, 2014 at 23:0
1
Solved
My device runs Android 5.1.1 and I found out that if I use
Toast.makeText(this, "This is a toast", Toast.LENGTH_SHORT).show();
I got this:
But if I use getApplicationContext() instead of this...
Umber asked 9/10, 2015 at 19:6
3
I have spent hours trying to fix an app crash and I think it deserves a question:
The Exception:
java.lang.IllegalStateException: View android.widget.LinearLayout{41a97eb8 V.E..... ......ID 0,0-5...
Erysipeloid asked 10/3, 2015 at 6:9
2
Solved
I would like one Toast message to display in one location and a different Toast message to display in another location simultaneously.
Multiple Toast messages seem to always queue and display in ...
Mantle asked 23/3, 2014 at 17:27
2
Solved
Spoiler: this post may contain something stupid due to being used to C and new to Java programming
There is an activity MainActivity and a public non-activity class containing a number of me...
Sherman asked 12/6, 2015 at 9:28
4
Solved
Please read the question before answering with your standard routine to print a Toast :)
I'd like to display a Custom Toast at the top left corner of the screen. I use this code to create the Toa...
Cyndycynera asked 18/11, 2014 at 6:53
5
I am trying to show a toast message in my application using the following code.
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Do you want to continue?");
alert.setPo...
Labuan asked 22/12, 2014 at 11:16
1
Solved
I am developing an application that uses WebView to display a webpage.
The webpage contains a registration form and a "next" button. I want
to know if it is possible to show Android toast message i...
Capacitate asked 21/4, 2015 at 18:9
© 2022 - 2024 — McMap. All rights reserved.