4

I am developing an android application in that I am using SQLite database for storing local data.

In simple query, it worked properly but when I'm using sub-query and joins I'm getting below exception:

E/CursorWindow(27359): Could not allocate CursorWindow '/data/data/com.example.demo/databases/db_demo.db' of size 2097152 due to error -12.

How to resolve this exception?

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Milind Soni
  • 81
  • 1
  • 5

1 Answers1

4

As per the Error -12 i think cursor leak. try to close it or handle it properly.

try {
    // your code
} finally { 
    cursor.close();
}

I hope it work. If not post code.

TWiStErRob
  • 41,170
  • 22
  • 156
  • 240
Govinda Paliwal
  • 3,171
  • 5
  • 20
  • 43