Android Question android.database.CursorWindowAllocationException: Cursor window allocation of 2097152 bytes failed

AHilberink

Active Member
Licensed User
Longtime User
Hi,

I got this error on the following sub:
B4X:
'KolomBestaat(Kolomnaam As String)
'Geeft True of False terug
Public Sub KolomBestaat(Tabelnaam As String, Kolomnaam As String) As Boolean
    Dim Koloms As ResultSet=Main.SQL1.ExecQuery("PRAGMA table_info("&Tabelnaam&")")
    Do While Koloms.NextRow
            If(Koloms.GetString2(1).ToLowerCase=Kolomnaam.ToLowerCase) Then Return True
    Loop
    Koloms.Close
    Return False
End Sub

This should be called about 300 times, but crashes after 142 times with the Cursor window failed.
As far as I can find, this could be caused by not closing a cursor, but as you can see I do.

This happens mostly on older tablets like Tab A6.

Can someone help me or do you need more info?
Kind regards,
André
 
Top