angel_ Well-Known Member Licensed User Longtime User Oct 1, 2020 #1 In B4XDrawer I have an option to change the language but when I change it, it does not change the language in the activities (classes), I have tried this but it does not work: B4XPages.GetNativeParent(MyActivity).Finish MyActivity.Initialize B4XPages.AddPageAndCreate("MyActivity", MyActivity) Last edited: Oct 2, 2020
In B4XDrawer I have an option to change the language but when I change it, it does not change the language in the activities (classes), I have tried this but it does not work: B4XPages.GetNativeParent(MyActivity).Finish MyActivity.Initialize B4XPages.AddPageAndCreate("MyActivity", MyActivity)
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2020 #2 There are no activities in B4XPages. You mean pages. The code you posted is completely wrong. If you want to recreate the layout then remove the views and load the layout again. Pages are never destroyed and you should never try to recreate a page. Upvote 0
There are no activities in B4XPages. You mean pages. The code you posted is completely wrong. If you want to recreate the layout then remove the views and load the layout again. Pages are never destroyed and you should never try to recreate a page.
angel_ Well-Known Member Licensed User Longtime User Oct 2, 2020 #3 Erel said: There are no activities in B4XPages. You mean pages. Click to expand... Ok Erel said: The code you posted is completely wrong. Click to expand... Ok, I've already crossed it out so as not to cause confusion Erel said: If you want to recreate the layout then remove the views and load the layout again. Pages are never destroyed and you should never try to recreate a page. Click to expand... Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) '....Code MyPage.Initialize MyPage.AddPageAndCreate("strMyPage", MyPage) End Sub Sub ChangeLanguage MyPage.Root.RemoveAllViews MyPage.LoadLyt End Sub Code: Copy Sub Class_Globals Public Root As B4XView End Sub Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 LoadLyt End Sub Public Sub LoadLyt '...Code End Sub Upvote 0
Erel said: There are no activities in B4XPages. You mean pages. Click to expand... Ok Erel said: The code you posted is completely wrong. Click to expand... Ok, I've already crossed it out so as not to cause confusion Erel said: If you want to recreate the layout then remove the views and load the layout again. Pages are never destroyed and you should never try to recreate a page. Click to expand... Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) '....Code MyPage.Initialize MyPage.AddPageAndCreate("strMyPage", MyPage) End Sub Sub ChangeLanguage MyPage.Root.RemoveAllViews MyPage.LoadLyt End Sub Code: Copy Sub Class_Globals Public Root As B4XView End Sub Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 LoadLyt End Sub Public Sub LoadLyt '...Code End Sub