M Mostez Well-Known Member Licensed User Longtime User Jun 20, 2020 #1 I display a toast message (BCToast) from Activity 1 before calling StartActivity 2, when I go back to Activity 1, the toast message still exist and it does not close. is it possible to use wait for, or any other method to handle this? Thanks
I display a toast message (BCToast) from Activity 1 before calling StartActivity 2, when I go back to Activity 1, the toast message still exist and it does not close. is it possible to use wait for, or any other method to handle this? Thanks
JohnC Expert Licensed User Longtime User Jun 20, 2020 #2 Please post the code where you display the toast and the name of the sub that the code is in. I have a feeling there is a bug that is causing the toast line of code to be run over and over again and it's giving the illusion its staying on. You can test this by adding the below line after your toast line: B4X: Copy ToastMessageShow("Some message that won't go away",False) '<--- this is your current line where you display the toast Log("Ran Toast message") Now, when the problem happens (when the toast wont close), look at the log events on the right side of the IDE and see if you now see repeating lines of "Ran Toast Message". If so, then something is causing that toast line to be run over and over - maybe a repeating event? Last edited: Jun 20, 2020 Upvote 0
Please post the code where you display the toast and the name of the sub that the code is in. I have a feeling there is a bug that is causing the toast line of code to be run over and over again and it's giving the illusion its staying on. You can test this by adding the below line after your toast line: B4X: Copy ToastMessageShow("Some message that won't go away",False) '<--- this is your current line where you display the toast Log("Ran Toast message") Now, when the problem happens (when the toast wont close), look at the log events on the right side of the IDE and see if you now see repeating lines of "Ran Toast Message". If so, then something is causing that toast line to be run over and over - maybe a repeating event?
M Mostez Well-Known Member Licensed User Longtime User Jun 20, 2020 #3 no John, when toast message displayed, and I did not click the button to start activity 2, after duration it close OK. But if I click the button to start activity 2 before it closes, it will be on forever. B4X: Copy Sub Globals Private Toast As BCToast B4X: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("main") Toast.Initialize(Activity) Toast.DurationMs = 1000 ..... ....... If Myuser.CanLog Then Toast.Show("e-trip Mobile, access granted") Upvote 0
no John, when toast message displayed, and I did not click the button to start activity 2, after duration it close OK. But if I click the button to start activity 2 before it closes, it will be on forever. B4X: Copy Sub Globals Private Toast As BCToast B4X: Copy Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("main") Toast.Initialize(Activity) Toast.DurationMs = 1000 ..... ....... If Myuser.CanLog Then Toast.Show("e-trip Mobile, access granted")
Erel B4X founder Staff member Licensed User Longtime User Jun 21, 2020 #4 Best option is to switch to B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages Upvote 0
Best option is to switch to B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages