Hi everyone!
Ok, I keep getting this problem. I have a SQLite (edited) database in my project, and I use DBUtils (latest version) to communicate with it.
If I run the code normally (pressing f5, even in Release mode), I get an error.
But if I run it using breaks every couple of lines, or even step-by-step, no errors occur and everything works fine.
It happens almost every time I want to interact with the database, I will post an example:
MY CODE:
THE ERROR:
Ok, I keep getting this problem. I have a SQLite (edited) database in my project, and I use DBUtils (latest version) to communicate with it.
If I run the code normally (pressing f5, even in Release mode), I get an error.
But if I run it using breaks every couple of lines, or even step-by-step, no errors occur and everything works fine.
It happens almost every time I want to interact with the database, I will post an example:
MY CODE:
B4X:
'LOADS ALL RESULTS TO A TABLE
Dim Table As List
Table.Initialize
Table = DBUtils.ExecuteMemoryTable(Starter.sqlDB, "SELECT * FROM evals WHERE usuario='" & Main.strUserName & "'", Null, 0)
If Table = Null Or Table.IsInitialized = False Then
'DOES NOTHING FOR NOW
Else
Dim Cols() As String
For dato = 0 To Table.Size - 1
Cols = Table.Get(dato)
'CHECKS A SPECIFIC COLUMN FOR A 'YES' VALUE. If so, it adds a line to a 2 line listview
If Cols(40) = "YES" Then
ListView1.AddTwoLinesAndBitmap2(Cols(4),Cols(5),LoadBitmap(File.DirAssets, "check.png"),Cols(0))
End If
Next
End If
THE ERROR:
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at cochero.appear.frmdatosanteriores._listardatos(frmdatosanteriores.java:536)
at cochero.appear.frmdatosanteriores._activity_resume(frmdatosanteriores.java:448)
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:339)
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.raiseEvent(BA.java:166)
at cochero.appear.frmdatosanteriores.afterFirstLayout(frmdatosanteriores.java:108)
at cochero.appear.frmdatosanteriores.access$000(frmdatosanteriores.java:17)
at cochero.appear.frmdatosanteriores$WaitForLayout.run(frmdatosanteriores.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5451)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Last edited: