I'm testing how a SQLite query works, here is a test code I was trying:
And it crashes somehow before showing anything,
If I put a new line before the InputList(....) line of code the whole code works properly.
I am obviouly doing something wrong here but don't know what. Also, I know that two first lines should have gone in the Activity_Create() sub but didn't want to mess up the project and it had been working all good like this until I added that InputList() line.
B4X:
Sub btnTest_Click
Dim dir As String = DBUtils.CopyDBFromAssets("test.db")
SQL.Initialize(dir, "test.db", True)
Dim SQLQuery As Map
Dim string2(0) As List
Dim list3 As List
string2 = DBUtils.ExecuteMemoryTable(SQL, "SELECT * FROM PERSONA", Null, 0).Get(0)
list3.Initialize2(string2)
Msgbox(list3, "Primer resultset")
'' INPUT?
InputList(string2, "title", -1)
'Return
.
.
.
End Sub
And it crashes somehow before showing anything,
B4X:
** Activity (login) Pause, UserClosed = false **
** Activity (storev2) Create, isFirst = true **
** Activity (storev2) Resume **
ExecuteMemoryTable: SELECT * FROM PERSONA
ExecuteMemoryTable: SELECT * FROM PERSONA
ExecuteJSON: select * from Persona
ExecuteMemoryTable: SELECT * FROM PERSONA
Error occurred on line: 191 (DBUtils)
java.lang.ClassCastException: java.lang.String[] cannot be cast to anywheresoftware.b4a.objects.collections.List[]
at b4a.mayorio.tienda.storev2._btntest_click(storev2.java:690)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
If I put a new line before the InputList(....) line of code the whole code works properly.
I am obviouly doing something wrong here but don't know what. Also, I know that two first lines should have gone in the Activity_Create() sub but didn't want to mess up the project and it had been working all good like this until I added that InputList() line.
Last edited: