If you look at the docs for SQLiteOpenHelper.close () ...
public synchronized void close ()
Close any open database object.
It does not close SQLiteOpenHelper
, it closes the database.
In addition to this, if you get the correct code, you can directly access the database object directly.
For example, if you have a query that you regularly use to get the cursor so that the adapter fills the view, create a method in your SQLiteOpenHelper
class and put the query in it.
In other words, don't get the link to the actual database in your main code, just get SQLiteOpenHelper
to do everything for you.
source share