Android Question PhoneState get name from database

sigster

Active Member
Licensed User
Longtime User
Hi

I am try to use PhoneStateChanged query IncomingNumber in database and display
I am getting this error if I try

java.lang.RuntimeException: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1

Regards
Sigster

B4X:
Select State
Case "RINGING"

        Dim Mobile_Encrypt As String
        Mobile_Encrypt = Encrypt(IncomingNumber)

      
Dim Cursor As Cursor
Cursor = xSQL.ExecQuery("select * from contact where mobile like '" &
Mobile_Encrypt 
& "%' order by name COLLATE UNICODE;")

If Cursor = Null Then

Else

  
        Dim Mobile_Decrypt As String
        Mobile_Decrypt = Decrypt(Cursor.GetString("mobile"))
        Log(Cursor.GetString(gsm_Decrypt))

End If
 
Last edited:

sigster

Active Member
Licensed User
Longtime User
it is fine I can don't have error anymore


For i = 0To Cursor.RowCount - 1
Cursor.Position = i
Log(Cursor.GetString("col1"))
Log(Cursor.GetInt("col2"))Next
 
Upvote 0
Top