weldsonandrade
weldsonandrade

Reputation: 626

Android SQLiteDatabase is locked

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

Answers (1)

Roy Hinkley
Roy Hinkley

Reputation: 10641

You need to release the database before attempting to establish another connection, or share the connection.

Upvotes: 2

Related Questions