You can use this code to get B4XPageInfo from a view. You do need to pass mBase for custom views, as this is the real view.
B4X:
Public Sub GetPageInfoFromView(view As B4XView) As B4XPageInfo
Dim pi As B4XPageInfo = Null
Do While view.IsInitialized And pi = Null
pi = B4XPages.GetManager.GetPageInfoFromRoot(view)
view = view.Parent
Loop
Return pi
End Sub
Public Sub GetPageInfoFromView(view As B4XView) As B4XPageInfo
Do While True
Dim pi As B4XPageInfo = B4XPages.GetManager.GetPageInfoFromRoot(view)
If pi <> Null Then
Return pi
Else
view = view.Parent
End If
Loop
Return Null
End Sub
O.T. I know by "OP" you mean who opened the thread but what does OP stand for? (Just out of curiosity since I prefer to mention the nickname directly, it's much friendlier)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.