The throwing of this exception does not cause the program to crash.
The exception information comes from the Finalize method of the sqlitedatabase class. From the exception information "close () was never explicitly called on database, application did not close the cursor or database object that was opened here
"It can be seen that this is caused by the cursor used in the program or the close of the sqlitedatabase object. That is to say, the cursor object or sqlitedatabase object created in the program is not closed after use, and the above information is displayed when they all become "junk" and are GC.
Java code
- @ Override
- Protected void finalize (){
- If (isopen ()){
- Log. E (TAG, "close () was never explicitly called on database'" +
- Mpath + "'", mstacktrace );
- Closeclosable ();
- Onallreferencesreleased ();
- }
- }
@Override protected void finalize() { if (isOpen()) { Log.e(TAG, "close() was never explicitly called on database '" + mPath + "' ", mStackTrace); closeClosable(); onAllReferencesReleased(); } }
To avoid such errors, remember to close () when you are not using cursor or sqlitedatabase objects (),