Android Question [B4XPages] changing language in activities

angel_

Well-Known Member
Licensed User
Longtime User
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:

angel_

Well-Known Member
Licensed User
Longtime User
There are no activities in B4XPages. You mean pages.
Ok

The code you posted is completely wrong.
Ok, I've already crossed it out so as not to cause confusion

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.

B4XMainPage:
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

strMyPage:
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
Top