Edu Portu Member Licensed User Longtime User Sep 16, 2020 #1 I have an B4A APP, i use activities and it's very easy, for a new form: B4X: Copy StartActivity(Nombre_Pantalla) and when i finish (or the user exit) B4X: Copy Activity.Finish everytimes that i enter in the activity the controls are created (activity_create) and when i exit the form/activity/page is destroyed In B4i i based in the Erel example, i call the form with: B4X: Copy Nombre_Pantalla.Show Show is a rutine with this code: B4X: Copy If pg.IsInitialized = False Then pg.Initialize("pg") 'Here Activity_Create code End If Main.NavControl.ShowPage(pg) when i finish: B4X: Copy Main.NavControl.RemoveCurrentPage but the form/activity/page not is destroyed, and when i recall to this form/page the controls are already created and with data. Is there any way, different of "RemoveCurrentPage" and more similar to "Activity.Finish" of Android? Thanks you and sorry for my bad english (50% my fault and 50% Google's fault ;-) )
I have an B4A APP, i use activities and it's very easy, for a new form: B4X: Copy StartActivity(Nombre_Pantalla) and when i finish (or the user exit) B4X: Copy Activity.Finish everytimes that i enter in the activity the controls are created (activity_create) and when i exit the form/activity/page is destroyed In B4i i based in the Erel example, i call the form with: B4X: Copy Nombre_Pantalla.Show Show is a rutine with this code: B4X: Copy If pg.IsInitialized = False Then pg.Initialize("pg") 'Here Activity_Create code End If Main.NavControl.ShowPage(pg) when i finish: B4X: Copy Main.NavControl.RemoveCurrentPage but the form/activity/page not is destroyed, and when i recall to this form/page the controls are already created and with data. Is there any way, different of "RemoveCurrentPage" and more similar to "Activity.Finish" of Android? Thanks you and sorry for my bad english (50% my fault and 50% Google's fault ;-) )
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2020 #2 Use B4XPages: [B4X] B4XPages - Cross platform and simple framework for managing multiple pages Upvote 0
Edu Portu Member Licensed User Longtime User Sep 16, 2020 #3 I think that the B4XPages is the future for my new APPs... But B4XPages is for doing the Android APP similar to iOS APP (pages/activities never is destroyed) But i have the Android APP finished with this system (Activity.finish) and i traslate the Android APP to iOS, and i have the iOS APP terminated with this system/problem... Another solution? Is very dificult to translate a finished APP with the old system to B4XPages? Upvote 0
I think that the B4XPages is the future for my new APPs... But B4XPages is for doing the Android APP similar to iOS APP (pages/activities never is destroyed) But i have the Android APP finished with this system (Activity.finish) and i traslate the Android APP to iOS, and i have the iOS APP terminated with this system/problem... Another solution? Is very dificult to translate a finished APP with the old system to B4XPages?
Semen Matusovskiy Well-Known Member Licensed User Sep 16, 2020 #4 Actually it's enough simple to imitate Android behaviour. Take a look old Erel's Three Pages sample. When you switch from Page1 to Page2 you can call your own ''Activity_Finish' in Page1 and to release views, resources etc. Another question that typically it not needed. Inactive views does not need a lot of memory. I see a reason to delete large bitmaps only. Upvote 0
Actually it's enough simple to imitate Android behaviour. Take a look old Erel's Three Pages sample. When you switch from Page1 to Page2 you can call your own ''Activity_Finish' in Page1 and to release views, resources etc. Another question that typically it not needed. Inactive views does not need a lot of memory. I see a reason to delete large bitmaps only.