I have an app in which I check to see if a panel is initialized in the page_resize event. If it is, then I resize this child panel of the page's root panel. This is used to determine if the layout should be loaded or if the content just needs to be resized.
When I remove a page from the navcontrol, the child panel still shows as being initialized. Is this a bug?
I have attached an example app.
To reproduce the problem:
1) click Open Page.
2) click Back
3) click Open Page again. Notice that nothing loads because the resize event is seeing the panel as still being initialized.
Here is the code where the problem happens.
When I remove a page from the navcontrol, the child panel still shows as being initialized. Is this a bug?
I have attached an example app.
To reproduce the problem:
1) click Open Page.
2) click Back
3) click Open Page again. Notice that nothing loads because the resize event is seeing the panel as still being initialized.
Here is the code where the problem happens.
B4X:
Private Sub Page2_Resize(Width As Int, Height As Int)
If ChildPanel.IsInitialized Then
Log("Child is initialized")
ChildPanel.Width=Width
ChildPanel.Height=Height
Else
Log("Child is not initialized")
ChildPanel.Initialize("")
Page2.RootPanel.AddView(ChildPanel,0,0,Width,Height)
ChildPanel.LoadLayout("newpage")
End If
End Sub