A
A
Andrew2014-07-04 10:03:41
Android
Andrew, 2014-07-04 10:03:41

What happens if you do not close the cursor in the android application?

Suppose we opened the cursor to the database, but did not close it anywhere. The user has closed the application. Will the cursor be closed/destroyed or will it hang in the device's memory until it is rebooted.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2014-07-04
@Xcam

The garbage collector will kill it, and when SQLiteDatabase is deleted, a warning will pop up in the log that you had non-closed databases. In general, nothing fatal, but it is still better to close the database when it is no longer needed, if possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question