iOS Question [SOLUCIONADO] CLOSE b4i ACTIVITIES (PAGES)

Edu Portu

Member
Licensed User
Longtime User
Good afternoon,

In B4A the activities are closed as you leave them and create as you enter ... That allows me to change the language (frances, ingles o portugues) in the APP easily, because the language is changed in the main menu and then when entering in the other options (ACTIVITIES) when created again, they are already loaded in the new language.

On the other hand, in B4i the "ACTIVITIES" (Pages) are never destroyed, so even if the language changes on the main screen when entering the other screens, as they are already created, they are still in the old language. Is there a way when the user changes languages to "destroy" all the other ACTIVITIES (Pages) except the main one so that they have to be reloaded?

Thank you
Edu

P.D.- Translate with Google Translator (excuse me)
 

Alex_197

Well-Known Member
Licensed User
Longtime User
Check Private Application_Background and Application_Foreground events in main module.

Let's say your current language is English. You started the app. Then you want to change the current language on your iPhone to Russian. In order to do it you have to go to the Settings. That means that your app goes into background and Application_Background fired. Then you reopen your app and Application_Foreground event fired where you can check the current language.
 
Upvote 0

Edu Portu

Member
Licensed User
Longtime User
I do not change the language in the system Settings, there is an option on the main screen of my APP to choose the language of the APP ...
And what I need is to change the language of the rest of the screens (ACTIVITIES/PAGES) of the APP ...
And for that I need to recreate those screens (ACTIVITIES/PAGES)...
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
I do not change the language in the system Settings, there is an option on the main screen of my APP to choose the language of the APP ...
And what I need is to change the language of the rest of the screens (ACTIVITIES/PAGES) of the APP ...
And for that I need to recreate those screens (ACTIVITIES/PAGES)...
Keep the language in the global variable and check it on page_Appear event
 
Upvote 0

Edu Portu

Member
Licensed User
Longtime User
Don't waste your time with B4A activities or B4i pages. Use B4XPages. Everything will be simpler and cross platform.

Now I have started to develop with B4XPages ...
But this is an old APP that they want to make multilingual, in B4A it has been easy (because ACTIVITIES are created every time they are called), but in B4i I can't find a way to solve it .. .
The only way is to reload all the labels and graphics in the Page_Appear?
 
Upvote 0

Edu Portu

Member
Licensed User
Longtime User
In the "Page_Appear" of each screen I reload all the controls (labels, buttons and imageviews):

B4X:
Sub Pg_Appear
    'Recargamos todas las teclas con el icono adecuado al idioma
    btnVolver.BitMap = LoadBitmap(File.DirAssets, Main.Idioma & "_generico_btnvolver.png")
    IVLblTitulo.Bitmap = LoadBitmap(File.DirAssets, Main.Idioma & "_ajustes_lbltitulo.png")
End Sub
 
Upvote 0
Top