how to create toast message

cwt

Active Member
Licensed User
Longtime User
I am new to Java and Android so please forgive my lack of knowledge.

How do you create a toast message?

Thanks
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I am new to Java and Android so please forgive my lack of knowledge.

How do you create a toast message?

You can easily find such information and related info by using the search function at the upper right corner of the forum pages as well as by searching the Documentation Wiki (highlighted in yellow above left).

See the thread How to Ask A Question for more tips.
 
Upvote 0

cwt

Active Member
Licensed User
Longtime User
Thanks for your patience, I did multiple searches prior to asking and could not find anything that showed how to declare a toast.

I would not ask without doing a search first. I am new to learning Java and Android but have been programming since 1974.

You would be better off to not assume everyone on this forum is an 18 year old kid.

Thanks
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I'm not sure I am following you.... there is nothing to declare for toast messages, you just write the statement. Kind of like logging:

B4X:
Log ("Log this!")

Are you having problems getting toast messages to show?
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Thanks for your patience, I did multiple searches prior to asking and could not find anything that showed how to declare a toast.

I would not ask without doing a search first. I am new to learning Java and Android but have been programming since 1974.

You would be better off to not assume everyone on this forum is an 18 year old kid.

When I search for "toast message", lots of examples of using it show up (see screenshot below), so the only asssumption I made was that you hadn't tried searching -- nothing to do with your age or years of programming experience, so no offense was intended. I was just pointing out some resources here.

toastmsg.jpg
 
Last edited:
Upvote 0

cwt

Active Member
Licensed User
Longtime User
Well, if I use this as I have seen in my search

ToastShowMessage("show message",True)

I get a compiler error:

Error description: Undeclared variable 'ToastShowMessage' is used before it was assigned any value.

Am I not understanding something here?

Thanks
 
Upvote 0

cwt

Active Member
Licensed User
Longtime User
Thanks everyone - I found my mistake

stupid oversight on my part - rather embarrassing

I was using ToastShowMessage instead of ToastMessageShow

Thanks for the help
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I can't find a reference to it here (perhaps someone else can?) but the latest version of B4A has syntax highlighting which is handy for spotting problems like that which can happen to anyone.

In the latest version, the colors will give it away. I found a couple variables in my project that I had forgotten to declare the first time I opened the project in the latest B4A version. :eek: And of course when using a keyword like ToastMessageShow it should be blue unless you have customized your IDE colors.
 
Upvote 0
Top