@Alexander Stolte, I have a problem when I want to present the menu with other options in a B4XPage that is not B4XMainPage. The strange thing is that it only happens in B4I.
I also attached in the post, a version of your example that simulates what I do in my application
Below I show you part of the code in B4XMainPage
If you want, you can see how the application works on Android to understand exactly what I mean in the steps that I now indicate.
1 Click on the first item (makes a .clear of the menu and fills with the sub-menu of the selected item)
BdD Base de datos = Database
2 Click again on the first item to access frmFilterPage
Equipos = Teams
3 Crash on B4I
Android app: https://play.google.com/store/apps/details?id=ar.com.sysprofile.psahb
Error
I also attached in the post, a version of your example that simulates what I do in my application
Below I show you part of the code in B4XMainPage
B4XMainPage:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
'AS_TabMenuAdvanced
Private btnTabMenu As AS_TabMenuAdvanced
#If B4I
Private xpnl_bottom As B4XView
#End If
End Sub
Private Sub B4XPage_Resize (Width As Int, Height As Int)
#If B4I
'AS_TabMenuAdvanced
xpnl_bottom.SetLayoutAnimated(0, 0, Height - B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom,Width,B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom)
btnTabMenu.mBase.Top = Height - btnTabMenu.mBase.Height - B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom
#End If
End Sub
Private Sub B4XPage_Created (RootView As B4XView)
#If B4I
'AS_TabMenuAdvanced
xpnl_bottom = xui.CreatePanel("")
Root.AddView(xpnl_bottom, 0, 0, Root.Width, B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom)
xpnl_bottom.Color = 0xFF202125
#End If
'AS_TabMenuAdvanced
btnTabMenu.Clear
btnTabMenu.AddTab(mdlFunctions.loc.Localize("fed_short"), xui.LoadBitmap(File.DirAssets, "icon_fed.png"), xui.LoadBitmap(File.DirAssets, "icon_fed.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("club_short"), xui.LoadBitmap(File.DirAssets, "icon_club.png"), xui.LoadBitmap(File.DirAssets, "icon_club.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("db_short"), xui.LoadBitmap(File.DirAssets, "icon_save.png"), xui.LoadBitmap(File.DirAssets, "icon_save.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("xlsx_short"), xui.LoadBitmap(File.DirAssets, "icon_xlsx.png"), xui.LoadBitmap(File.DirAssets, "icon_xlsx.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("back_short"), xui.LoadBitmap(File.DirAssets, "icon_previus.png"), xui.LoadBitmap(File.DirAssets, "icon_previus.png"))
btnTabMenu.GetTab(0).xTab.Tag = "fed"
btnTabMenu.GetTab(1).xTab.Tag = "club"
btnTabMenu.GetTab(2).xTab.Tag = "saveToDB"
btnTabMenu.GetTab(3).xTab.Tag = "saveToFile"
btnTabMenu.GetTab(btnTabMenu.GetTabs.Size - 1).xTab.Tag = "back"
btnTabMenu.GetTab(1).xTab.Enabled = False
btnTabMenu.GetTab(2).xTab.Enabled = False
btnTabMenu.GetTab(3).xTab.Enabled = False
btnTabMenu.Refresh
End Sub
If you want, you can see how the application works on Android to understand exactly what I mean in the steps that I now indicate.
1 Click on the first item (makes a .clear of the menu and fills with the sub-menu of the selected item)
BdD Base de datos = Database
2 Click again on the first item to access frmFilterPage
Equipos = Teams
3 Crash on B4I
Android app: https://play.google.com/store/apps/details?id=ar.com.sysprofile.psahb
frmFilterPage:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
'AS_TabMenuAdvanced
Private btnTabMenu As AS_TabMenuAdvanced
#If B4I
Private xpnl_bottom As B4XView
#End If
End Sub
Private Sub B4XPage_Resize (Width As Int, Height As Int)
#If B4I
'AS_TabMenuAdvanced
xpnl_bottom.SetLayoutAnimated(0,0,Height - B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom,Width,B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom)
btnTabMenu.mBase.Top = Height - btnTabMenu.mBase.Height - B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom
#End If
End Sub
Private Sub B4XPage_Created (RootView As B4XView)
Root = RootView
Root.LoadLayout("frmFilter")
#If B4I
'AS_TabMenuAdvanced
xpnl_bottom = xui.CreatePanel("")
Root.AddView(xpnl_bottom, 0, 0, Root.Width, B4XPages.GetNativeParent(Me).SafeAreaInsets.Bottom)
xpnl_bottom.Color = 0xFF202125
#End If
btnTabMenu.AddTab(mdlFunctions.loc.Localize("fed_short"), xui.LoadBitmap(File.DirAssets, "icon_fed.png"), xui.LoadBitmap(File.DirAssets, "icon_fed.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("club_short"), xui.LoadBitmap(File.DirAssets, "icon_club.png"), xui.LoadBitmap(File.DirAssets, "icon_club.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("xlsx_short"), xui.LoadBitmap(File.DirAssets, "icon_xlsx.png"), xui.LoadBitmap(File.DirAssets, "icon_xlsx.png"))
btnTabMenu.AddTab(mdlFunctions.loc.Localize("back_short"), xui.LoadBitmap(File.DirAssets, "icon_previus.png"), xui.LoadBitmap(File.DirAssets, "icon_previus.png"))
btnTabMenu.Refresh
btnTabMenu.GetTab(0).xTab.Tag = "fed"
btnTabMenu.GetTab(1).xTab.Tag = "club"
btnTabMenu.GetTab(2).xTab.Tag = "saveToFile"
btnTabMenu.GetTab(3).xTab.Tag = "back"
btnTabMenu.Refresh
End Sub
Error
Application_Start
Device locale: es
Found 161 strings.
*** : B4XPage_Foreground
*** mainpage: B4XPage_Created
Application_Active
*** mainpage: B4XPage_Appear [mainpage]
*** mainpage: B4XPage_Resize [mainpage]
Found 161 strings.
Found 161 strings.
Class (b4i_httpjob) instance released.
Class (b4i_httpjob) instance released.
*** frmxfilter: B4XPage_Created [mainpage]
Error occurred on line: 174 (AS_TabMenuAdvanced)
Target is null. Method called: _initialize:::
Stack Trace: (
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 540460
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 1582812
PasSportsAr Handball +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 160
PasSportsAr Handball -[B4ICustomViewWrapper AfterDesignerScript] + 1468
PasSportsAr Handball -[B4ILayoutBuilder loadLayout:::] + 1992
PasSportsAr Handball -[B4IPanelWrapper LoadLayout::] + 176
PasSportsAr Handball -[B4XViewWrapper LoadLayout::] + 80
PasSportsAr Handball -[ResumableSub_frmfilterpage_B4XPage_Created resume::] + 496
PasSportsAr Handball -[b4i_frmfilterpage _b4xpage_created::] + 412
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr Handball +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr Handball -[B4ICommon CallSubDebug4::::] + 832
PasSportsAr Handball -[B4ICommon CallSubDebug2::::] + 272
PasSportsAr Handball -[b4i_b4xpagesmanager _createpageifneeded::] + 888
PasSportsAr Handball -[b4i_b4xpagesmanager _showpage::] + 636
PasSportsAr Handball -[b4i_b4xpages _showpage:] + 388
PasSportsAr Handball -[ResumableSub_b4xmainpage_btnTabMenu_TabClick resume::] + 4048
PasSportsAr Handball -[b4i_b4xmainpage _btntabmenu_tabclick::] + 404
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr Handball +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr Handball -[B4IShell runMethod:] + 420
PasSportsAr Handball -[B4IShell raiseEventImpl:method:args::] + 1968
PasSportsAr Handball -[B4IShellBI raiseEvent:eventarams:] + 1360
PasSportsAr Handball -[B4ICommon CallSub4::::] + 240
PasSportsAr Handball -[B4ICommon CallSub2::::] + 272
PasSportsAr Handball -[b4i_as_tabmenuadvanced _tabclickevent::] + 824
PasSportsAr Handball -[b4i_as_tabmenuadvanced _tabclick:::] + 3960
PasSportsAr Handball -[b4i_as_tabmenuadvanced _xpnl_tab_click:] + 436
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 133140
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 129120
PasSportsAr Handball +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1296
PasSportsAr Handball -[B4IShell runMethod:] + 420
PasSportsAr Handball -[B4IShell raiseEventImpl:method:args::] + 1968
PasSportsAr Handball -[B4IShellBI raiseEvent:eventarams:] + 1360
PasSportsAr Handball __33-[B4I raiseUIEvent:eventarams:]_block_invoke + 52
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 8508
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 15828
libdispatch.dylib 81D355DF-266A-3010-BAB8-113B76A206C1 + 75172
libdispatch.dylib _dispatch_main_queue_callback_4CF + 44
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 354064
CoreFoundation 00E76A98-210C-3CB5-930B-F236807FF24C + 342292
CoreFoundation CFRunLoopRunSpecific + 608
GraphicsServices GSEventRunModal + 164
UIKitCore 1741FA37-4E53-371E-8DAE-D611AAB0043D + 4237580
UIKitCore UIApplicationMain + 340
PasSportsAr Handball main + 100
dyld 71846EAC-EE65-3697-BF7D-790B6A07DCDB + 249420
)
Attachments
Last edited: