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
  • 732,580
  • 175
  • 1,330
  • 1,459
Milind Soni
  • 81
  • 1
  • 5

1 Answers1

5

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
  • 44,762
  • 26
  • 170
  • 254
Govinda P
  • 3,261
  • 5
  • 22
  • 43