I do not see any methods in SQLiteDatabase class and SQLiteDatabaseOpener Therefore I got this error:
AndroidRuntime(806): Caused by: java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable
What would be a good way of designing it so that I can use the database throughout say a certain class?
Thanks!
The answer is right here
Exception: attempt to acquire a reference on a close SQLiteClosable
This one drove me insane for the longest time. The solution I have found is fairly simple: don’t keep references to SQLiteDatabase objects. Instead, use a SQLiteOpenHelper and call getWritableDatabase() every time you need one. From the docs: