Detect ToastMessage

metrick

Active Member
Licensed User
Longtime User
Is it possible to detect ToastMessage and cancel it before new ToastMessage is fired?
 

AscySoft

Active Member
Licensed User
Longtime User
No.

If a message was shown in the last 5 seconds then the new one is ignored. I used it to avoid the case where many messages where displayed one after another for a long time.

Is it possible to close current message(if exists), or current messages queue and instantly display only the new one?
I kind of need it, although there is now a custom class to do this!
 
Upvote 0

AscySoft

Active Member
Licensed User
Longtime User
I kind of need it, although there is now a custom class to do this!

Perhaps you could try this class.

I know that, but i wanna know if ToastMessageShow could be "upgraded" to "clear previous messages" or something
In worst case I will use another class, because I try to make everything simple!
Thanks anyway!
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
My class does just what you are looking for and it is simple to use. It takes two lines of code to set it up and just one to call it. You must use the one labeled: CToast_9PatchSound.zip

B4X:
'Add these two lines to Globals
Dim MyT As CToast
MyT.Initialize(Activity, Me, Activity.Height, Activity.Width)
   
'Call ToastMessage with this code
MyT.ToastShow("This is the new toast...", 3)
 
Upvote 0
Top