Hi,
I have a b4X Page application with the B4XMainPage invoking another page (say Pg1).
I want some default values to be set when the Pg1 is created due to which I have written the relevant code in the
B4XPage_Created event under Pg1.
I am exiting the app via B4X_CloseRequest with the following code in the B4XMainPage:
Now, When the end-user exits the Application, due to the Android OS feature, the app still remains in the Cache.
The issue:
In case when the end-user immediately invokes the application again, the B4XPage_Created event does not get fired for pg1 ('cuz for the Android OS the Page is still there in memory).
So how should we ensure that the B4XPage_Created event gets fired EVERYTIME for a page (EVEN in case the end-user suddenly re-invokes a 'previously exited' app but which 'gets invoked from the Cache') ?
Requesting for guidance.
Thanks.
I have a b4X Page application with the B4XMainPage invoking another page (say Pg1).
I want some default values to be set when the Pg1 is created due to which I have written the relevant code in the
B4XPage_Created event under Pg1.
I am exiting the app via B4X_CloseRequest with the following code in the B4XMainPage:
B4X:
Private Sub B4XPage_CloseRequest As ResumableSub
Log("B4x MainPage close event triggered")
Dim cs As CSBuilder
Dialog.BodyTextColor=xui.Color_White
Dialog.Title = cs.Initialize.Size(20).Append("Message").PopAll
Wait For (Dialog.Show("Are you sure?","Yes","No","Cancel" )) Complete ( Result As Int)
If Result=xui.Dialogresponse_Positive Then
B4XPages.ClosePage(Me)
Return(True)
End If
Return(False)
End Sub
Now, When the end-user exits the Application, due to the Android OS feature, the app still remains in the Cache.
The issue:
In case when the end-user immediately invokes the application again, the B4XPage_Created event does not get fired for pg1 ('cuz for the Android OS the Page is still there in memory).
So how should we ensure that the B4XPage_Created event gets fired EVERYTIME for a page (EVEN in case the end-user suddenly re-invokes a 'previously exited' app but which 'gets invoked from the Cache') ?
Requesting for guidance.
Thanks.
Last edited: