b4xpagesmanager._createpageifneeded (java line: 304)
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:513)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:459)
at b4j.L2P.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:304)
at b4j.L2P.b4xpagesmanager._showpage(b4xpagesmanager.java:719)
at b4j.L2P.b4xpagesmanager._addpage(b4xpagesmanager.java:116)
at b4j.L2P.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:123)
at b4j.L2P.b4xpagesmanager._initialize(b4xpagesmanager.java:488)
at b4j.L2P.main._appstart(main.java:61)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.L2P.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException
at b4j.L2P.b4xcombobox._setitems(b4xcombobox.java:291)
at b4j.L2P.b4xmainpage._fillcombobox(b4xmainpage.java:108)
at b4j.L2P.b4xmainpage._b4xpage_created(b4xmainpage.java:50)
at b4j.L2P.b4xmainpage.callSub(b4xmainpage.java:141)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:488)
... 23 more
Any reason for not uploading a small project showing the problem?Any reason for this to happen?
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Page1 As B4XPage1
Private lblPage1 As B4XView
Private xcbxMainPage As B4XComboBox
Public SelectedIndex As Int 'Selected index'
Public SelectedItem As String 'Selected item'
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Page1.Initialize
B4XPages.AddPage("Page 1", Page1)
FillComboBox
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Private Sub FillComboBox
Private i As Int
Private lst As List
lst.Initialize
For i=0 To 10
lst.Add("Main" & i)
Next
xcbxMainPage.SetItems(lst)
xcbxMainPage.SelectedIndex = SelectedIndex
SelectedItem = xcbxMainPage.SelectedItem ' memorise the index'
End Sub
Private Sub btnPage1_Click
B4XPages.ShowPage("Page 1")
End Sub
Private Sub xcbxMainPage_SelectedIndexChanged (Index As Int)
SelectedIndex = Index 'memorise the index
SelectedItem = xcbxMainPage.SelectedItem ' memorise the index
End Sub
Public Sub Update
lblPage1.Text = Page1.SelectedItem
End Sub