我的 android 应用程序正在使用手机的 SQLiteDatabase。似乎在应用程序崩溃的某个时刻,我的很多页面/片段突然无法工作,因为数据库被永久锁定。
有没有办法手动解锁/消除问题,以便我可以再次开始访问我的其他功能?相同的代码在我其他朋友的手机上工作,所以我相信我需要在我自己的手机上手动解锁数据库才能再次进行调试。
如果有帮助,以下是我的(已编辑:完整)logcat:
02-08 11:15:34.880: E/SqliteDatabaseCpp(10363): sqlite3_exec - Failed to set synchronous mode = 1(Normal)
02-08 11:15:34.895: E/SQLiteDatabase(10363): Failed to open the database. closing it.
02-08 11:15:34.895: E/SQLiteDatabase(10363): android.database.sqlite.SQLiteDatabaseLockedException: database is locked
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1132)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1083)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1170)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:844)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:228)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at com.sqlite.database.PlaceDataSource.open(PlaceDataSource.java:26)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at com.activities.TravelogueListBaseAdapter.getView(TravelogueListBaseAdapter.java:163)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.AbsListView.obtainView(AbsListView.java:2197)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.ListView.onMeasure(ListView.java:1155)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1385)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.measureVertical(LinearLayout.java:670)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:563)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1385)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1027)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:565)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at shared.ui.actionscontentview.ActionsContentView.onMeasure(ActionsContentView.java:259)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.measureVertical(LinearLayout.java:822)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:563)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2257)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1240)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2628)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.os.Handler.dispatchMessage(Handler.java:99)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.os.Looper.loop(Looper.java:137)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at android.app.ActivityThread.main(ActivityThread.java:4511)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at java.lang.reflect.Method.invokeNative(Native Method)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at java.lang.reflect.Method.invoke(Method.java:511)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
02-08 11:15:34.895: E/SQLiteDatabase(10363): at dalvik.system.NativeStart.main(Native Method)
02-08 11:15:34.900: E/AndroidRuntime(10363): FATAL EXCEPTION: main
02-08 11:15:34.900: E/AndroidRuntime(10363): android.database.sqlite.SQLiteDatabaseLockedException: database is locked
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1132)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1083)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1170)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:844)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:228)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
02-08 11:15:34.900: E/AndroidRuntime(10363): at com.sqlite.database.PlaceDataSource.open(PlaceDataSource.java:26)
02-08 11:15:34.900: E/AndroidRuntime(10363): at com.activities.TravelogueListBaseAdapter.getView(TravelogueListBaseAdapter.java:163)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.AbsListView.obtainView(AbsListView.java:2197)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.ListView.onMeasure(ListView.java:1155)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1385)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.measureVertical(LinearLayout.java:670)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:563)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1385)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1027)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:565)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at shared.ui.actionscontentview.ActionsContentView.onMeasure(ActionsContentView.java:259)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.measureVertical(LinearLayout.java:822)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.LinearLayout.onMeasure(LinearLayout.java:563)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4703)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-08 11:15:34.900: E/AndroidRuntime(10363): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2257)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.View.measure(View.java:12929)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1240)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2628)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.os.Handler.dispatchMessage(Handler.java:99)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.os.Looper.loop(Looper.java:137)
02-08 11:15:34.900: E/AndroidRuntime(10363): at android.app.ActivityThread.main(ActivityThread.java:4511)
02-08 11:15:34.900: E/AndroidRuntime(10363): at java.lang.reflect.Method.invokeNative(Native Method)
02-08 11:15:34.900: E/AndroidRuntime(10363): at java.lang.reflect.Method.invoke(Method.java:511)
02-08 11:15:34.900: E/AndroidRuntime(10363): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
02-08 11:15:34.900: E/AndroidRuntime(10363): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
02-08 11:15:34.900: E/AndroidRuntime(10363): at dalvik.system.NativeStart.main(Native Method)
02-08 11:15:34.920: E/android.os.Debug(1981): !@Dumpstate > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error
02-08 11:15:35.420: E/lights(1981): write_int: path