Android Question Error Object should first be initialized.

MarcioCC

Member
Licensed User
Longtime User
Good evening friends, here is an error that I can not solve.
Error: Error occurred on line: 538 (Main)
Java.lang.RuntimeException: Object should first be initialized.
Objects are all initialized.
Follow the code with the line where you are giving the error:

B4X:
Sub Edt_localiza_TextChanged (Old As String, New As String)
               
        Private i As Int
        New = Edt_localiza.Text

        Lv_adiciona_local.Clear
       
        // Line:538 // Cursor2  = SQL1.ExecQuery("SELECT * FROM PRODUTOS WHERE CODBARRAS LIKE '%${New}%'")

                  For i = 0 To Cursor2.RowCount - 1
                 Cursor2.Position = i
                 Lv_adiciona_local.AddSingleLine(Cursor2.GetString("CODBARRAS"))
        Next
       
   
End Sub
 

Ajws

Member
Licensed User
Good evening friends, here is an error that I can not solve.
Error: Error occurred on line: 538 (Main)
Java.lang.RuntimeException: Object should first be initialized.
Objects are all initialized.
Follow the code with the line where you are giving the error:

B4X:
Sub Edt_localiza_TextChanged (Old As String, New As String)
              
        Private i As Int
        New = Edt_localiza.Text

        Lv_adiciona_local.Clear
      
        // Line:538 // Cursor2  = SQL1.ExecQuery("SELECT * FROM PRODUTOS WHERE CODBARRAS LIKE '%${New}%'")

                  For i = 0 To Cursor2.RowCount - 1
                 Cursor2.Position = i
                 Lv_adiciona_local.AddSingleLine(Cursor2.GetString("CODBARRAS"))
        Next
      
  
End Sub


Try to initialilzed on create....

If sql1.IsInitialized = False Then
sql1.Initialize(File.DirInternal, "your database name",False)
End If
 
Upvote 0
Top