OK I may be missing something here, so need a second pair of eyes to look this over. I am using a tabhostview and adding panels holding other views rather than loading layouts. In the code below I get a NullPointerException on the line
I have been running this with just the pnlConductors operational and it works fine. I have just started setting up the pnlResults bit and got this error. I cannot understand it as the setting up code is practically identical to the pnlConductors code. Hope that makes sense, anyways here is the code.
B4X:
pnlResults.Width = TabMain.Width - 20dip
I have been running this with just the pnlConductors operational and it works fine. I have just started setting up the pnlResults bit and got this error. I cannot understand it as the setting up code is practically identical to the pnlConductors code. Hope that makes sense, anyways here is the code.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("TabScreen")
Activity.Title = "Conduit Size Calculator"
#Region Initialize Views
'Lists
Conductors.Initialize
'Maps
ConductorCount.Initialize
'Panels
pnlConductors.Initialize("")
pnlResults.Initialize("")
'Labels
'Buttons
'Webviews
wvResults.Initialize("") 'No event name currently required
#End Region
TabMain.Width = 100%x
TabMain.Height = 100%y
TabMain.AddTab2("Conductors", pnlConductors)
TabMain.AddTab2("Results", pnlResults)
#Region pnlConductors
pnlConductors.Width = TabMain.Width - 20dip
pnlConductors.Height = TabMain.Height
pnlConductors.LoadLayout("ConduitConductors")
svConductors.Color = Colors.Black
svConductors.Panel.Color = Colors.Black
svConductors.Panel.Width = svConductors.Width
spinLength.AddAll(Array As String("1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "6", "7", "8", "9", "10"))
spinBends.AddAll(Array As String("0", "1", "2", "3", "4"))
#End Region
#Region pnlResults
pnlResults.Width = TabMain.Width - 20dip
pnlResults.Height = TabMain.Height
pnlResults.AddView(wvResults, 0, 0, pnlResults.Width, pnlResults.Height)
wvResults.Color = Colors.Black
wvResults.ZoomEnabled = False
#End Region
LoadResults
LoadConductors
End Sub