Android’s Notepad tutorial Notepadv3 opens its database but never explicitly closes it. To make it correct, should Notepadv3 close its database, presumably with mDbHelper.close();
and, if so, where should that line of code appear?
Updated with a related question: The close method of NotesDbAdapter in the tutorial is implemented via mDbHelper.close()
. Would it be equally effective to implement the close method via mDb.close()
? In other words, is the close method of SQLiteDatabase equivalent to the close method of SQLiteOpenHelper and, if not, why is one preferred over the other?