Sub Test:
pnContainer, "a B4XView Pane", contains 6 "B4XView Panes".
The first time you call this Sub, no errors; the second time, it throws the casting exception as per the title of this thread, for the first Pane contained, Pane2.
Sub Test2:
It works without error.
pnContainer, "a B4XView Pane", contains 6 "B4XView Panes".
The first time you call this Sub, no errors; the second time, it throws the casting exception as per the title of this thread, for the first Pane contained, Pane2.
Sub Test2:
It works without error.
B4X:
Private Sub Test
For Each xView As B4XView In pnContainer.GetAllViewsRecursive
Log(xView.Tag)
Dim xCanvas As B4XCanvas
xCanvas.Initialize(xView)
xCanvas.Release
Next
End Sub
B4X:
Private Sub Test2
Log("Test2")
Dim xCanvas As B4XCanvas
xCanvas.Initialize(Pane2)
xCanvas.Release
Dim xCanvas As B4XCanvas
xCanvas.Initialize(Pane2)
xCanvas.Release
End Sub
Attachments
Last edited: