iOS Question ACTIVITIES IN B4i

Edu Portu

Member
Licensed User
Longtime User
I have an B4A APP, i use activities and it's very easy, for a new form:
B4X:
StartActivity(Nombre_Pantalla)
and when i finish (or the user exit)
B4X:
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:
Nombre_Pantalla.Show
Show is a rutine with this code:
B4X:
    If pg.IsInitialized = False Then
        pg.Initialize("pg")
        'Here Activity_Create code
    End If
    Main.NavControl.ShowPage(pg)
when i finish:
B4X:
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 ;-) )
 

Edu Portu

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

Semen Matusovskiy

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