Hello all,
I trying to create a B4XSwitch in runtime using the code:
But this is generating the error:
java.lang.RuntimeException: Object should first be initialized (B4XView).
When I add the b4xswitch using the designer there is no error.
What am I doing wrong? Is it impossible to add B4Xviews at runtime ?
I trying to create a B4XSwitch in runtime using the code:
B4X:
Dim itemEnabled As B4XSwitch
itemEnabled.Initialize(Me,"itemEnabled")
itemEnabled.mBase.AddView(pnlEditItem,10,panelPos,txtPrice.Height * 4,txtPrice.Height)
But this is generating the error:
java.lang.RuntimeException: Object should first be initialized (B4XView).
When I add the b4xswitch using the designer there is no error.
What am I doing wrong? Is it impossible to add B4Xviews at runtime ?