MrKim Well-Known Member Licensed User Longtime User May 8, 2021 #1 RE: https://www.b4x.com/android/forum/threads/b4xpages-bctoast-keep-visible-if-i-close-a-page.120390/ This solution: Toast.Initialize(B4XPages.GetNativeParent(Me)) Is fine for B4A but fails in B4J (Have not yet tested B4i) I am writing a cross platform solution. Is there a way to do this in B4J/ B4i? Thanks
RE: https://www.b4x.com/android/forum/threads/b4xpages-bctoast-keep-visible-if-i-close-a-page.120390/ This solution: Toast.Initialize(B4XPages.GetNativeParent(Me)) Is fine for B4A but fails in B4J (Have not yet tested B4i) I am writing a cross platform solution. Is there a way to do this in B4J/ B4i? Thanks
jahswant Well-Known Member Licensed User Longtime User May 8, 2021 #2 In B4J every page is a different form same in B4i it’s a different page. That solution will only work in B4A. Create one object in different pages. Upvote 0
In B4J every page is a different form same in B4i it’s a different page. That solution will only work in B4A. Create one object in different pages.
Erel B4X founder Staff member Licensed User Longtime User May 9, 2021 #3 You can do something like this in B4XMainPage: B4X: Public ShowToast (Root As B4XView, Message As String) toast.pnl.RemoveViewFromParent Root.AddView(toast.pnl, 0, 0, 0, 0) toast.Show(Message) End Sub You can call this sub from other pages: B4X: B4XPages.MainPage.ShowToast(Root, "asdasd") Upvote 0
You can do something like this in B4XMainPage: B4X: Public ShowToast (Root As B4XView, Message As String) toast.pnl.RemoveViewFromParent Root.AddView(toast.pnl, 0, 0, 0, 0) toast.Show(Message) End Sub You can call this sub from other pages: B4X: B4XPages.MainPage.ShowToast(Root, "asdasd")