我正在尝试在"Service"
失败中打开一个 SQLiteDatabase,但出现以下异常:
10-21 19:33:23.547: E/SqliteDatabaseCpp(31208): sqlite3_exec - Failed to set synchronous mode = 1(Normal)
10-21 19:33:23.547: E/SQLiteDatabase(31208): Failed to open the database. closing it.
10-21 19:33:23.547: E/SQLiteDatabase(31208): android.database.sqlite.SQLiteDatabaseLockedException: database is locked
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1135)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1086)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1173)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:858)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:228)
10-21 19:33:23.547: E/SQLiteDatabase(31208): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
有人可以解释一下这是什么意思吗?以及如何解决?数据库在MainActivity
和中打开Service
。