Hi
I wonder if you could help with adding these programmatically please?
I've added the following but get an error...
Dim lblSoundSwitch As Label
lblSoundSwitch.Initialize("lblSoundSwitch")
Private SDSwitch1 As SDSwitch
SDSwitch1.Initialize(SDSwitch1,"SDSwitch1")
SDSwitch1.loadInternalBitmap("Blue")
Dim Props As Map
Props.Initialize
Props.Put("Left","25")
Props.Put("Top","45")
Props.Put("Height","10")
Props.Put("Width","20")
Props.Put("Enabled","True")
Props.Put("Visible","True")
SDSwitch1.DesignerCreateView(transparentPanel,lblSoundSwitch,Props)
The error, which is raised on the DesignerCreateView, I get is :
java.lang.RuntimeException: Cannot parse: null as boolean
at anywheresoftware.b4a.BA.parseBoolean(BA.java:607)
at anywheresoftware.b4a.BA.ObjectToBoolean(BA.java:677)
at b4a.example.sdswitch._designercreateview(sdswitch.java:63)
at torquesoft.spaceinvaders.main._i_main_button_click(main.java:1319)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24779)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:180)
at android.app.ActivityThread.main(ActivityThread.java:6950)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:835)
I guess I'm not setting something that the DesignerView is expecting or am I getting something else wrong? Any help would be appreciated, the toggle switches look great, but I'm trying to add them programmatically.