I have Sqlite db with text and integer (having 1 or 0 for boolean)
I use PreferencesDialog to input each row.
Now if data row has 0 as integer then the boolean in PreferencesDialog show switch as OFF.
But if data row has 1 as integer then the boolean in PreferencesDialog show error below, instead of showing switch as ON
How to fix it ?
I use PreferencesDialog to input each row.
Now if data row has 0 as integer then the boolean in PreferencesDialog show switch as OFF.
But if data row has 1 as integer then the boolean in PreferencesDialog show error below, instead of showing switch as ON
B4X:
Logger connected to: Xiaomi M2006C3MII
--------- beginning of system
--------- beginning of main
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Error occurred on line: 442 (PreferencesDialog)
java.lang.RuntimeException: Cannot parse: 1 as boolean
at anywheresoftware.b4a.BA.parseBoolean(BA.java:640)
at anywheresoftware.b4a.BA.ObjectToBoolean(BA.java:710)
at b4a.B4XPages_SQLiteLight2.preferencesdialog._filldata(preferencesdialog.java:2459)
at b4a.B4XPages_SQLiteLight2.preferencesdialog$ResumableSub_ShowDialog.resume(preferencesdialog.java:587)
at b4a.B4XPages_SQLiteLight2.preferencesdialog._showdialog(preferencesdialog.java:405)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7184)
at android.view.View.performClickInternal(View.java:7157)
at android.view.View.access$3500(View.java:821)
at android.view.View$PerformClick.run(View.java:27660)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:225)
at android.app.ActivityThread.main(ActivityThread.java:7563)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)
How to fix it ?