启动时应用程序崩溃。

时间:2012-01-05 04:25:48

标签: android service boot

我在这里根据以下链接提出问题,       这是我的朋友提出的问题,有人可以回答下面的问题   after bootup,crashing

log cat错误如下所示:

01-03 22:19:46.097: E/AndroidRuntime(240): FATAL EXCEPTION: main
01-03 22:19:46.097: E/AndroidRuntime(240): java.lang.RuntimeException: Unable to create service com.android.antitheft.MyService: java.lang.IllegalStateException: get field slot from row 0 col -1 failed
01-03 22:19:46.097: E/AndroidRuntime(240): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.os.Looper.loop(Looper.java:123)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-03 22:19:46.097: E/AndroidRuntime(240): at java.lang.reflect.Method.invokeNative(Native Method)
01-03 22:19:46.097: E/AndroidRuntime(240): at java.lang.reflect.Method.invoke(Method.java:521)
01-03 22:19:46.097: E/AndroidRuntime(240): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-03 22:19:46.097: E/AndroidRuntime(240): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-03 22:19:46.097: E/AndroidRuntime(240): at dalvik.system.NativeStart.main(Native Method) 01-03 22:19:46.097: E/AndroidRuntime(240): Caused by: java.lang.IllegalStateException: get field slot from row 0 col -1 failed
01-03 22:19:46.097: E/AndroidRuntime(240): at android.database.CursorWindow.getString_native(Native Method)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.database.CursorWindow.getString(CursorWindow.java:329)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)
01-03 22:19:46.097: E/AndroidRuntime(240): at com.android.antitheft.MyService.onCreate(MyService.java:69)
01-03 22:19:46.097: E/AndroidRuntime(240): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
01-03 22:19:46.097: E/AndroidRuntime(240): ... 10 more

2 个答案:

答案 0 :(得分:1)

我已在原帖中评论过了。 会在这里重新说一下:

错误表示应用程序尝试访问索引为-1的DB列。我相信它发生是因为应用程序从Cursor.getColumnIndex(“secure”)收到无效索引; 检查数据库,我认为那里没有“安全”列。

答案 1 :(得分:0)

在数据库中的光标中使用movetonext