Reputation: 626
whenever I use the database I create a new instance of SQLOpenHelper.
I have a screen A that has a method that uses readableDatabase () in onResume (). In the screen B when it starts one AsyncTask that calls a method that uses writeableDatabase ().
If the thread ends after closing the display screen B then A can not access the database. So I get SQLitedatabase is locked.
So what I have to do?
Upvotes: 1
Views: 224
Reputation: 10641
You need to release the database before attempting to establish another connection, or share the connection.
Upvotes: 2