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