2012-01-05 309 views
0

我在這裏根據以下鏈接提問, 這是我的朋友問的問題有人可以回答下面的問題。如下所示
after bootup,crashing啓動時應用程序崩潰。

日誌貓錯誤:

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 
+1

MyService.java中第69行的代碼行是幹什麼的?只需發佈logcat是沒有用的 - 我們需要查看代碼,特別是該行以及之前的任何代碼。 – Squonk 2012-01-05 04:36:41

+0

你可以請你發佈你的服務課程嗎? – Praveenkumar 2012-01-05 04:42:09

+0

檢查我所描述的鏈接,我提供了服務類 – Ramz 2012-01-05 04:56:33

回答

0

在數據庫的光標中使用movetonext

+0

好,讓我檢查 – Ramz 2012-01-09 06:27:22

1

我已經在原來的線程評論。 將在這裏重新短語:

錯誤說應用程序試圖訪問索引爲-1的數據庫列。我相信這是因爲應用程序從Cursor.getColumnIndex(「secure」)收到無效索引。 檢查數據庫,我認爲那裏沒有「安全」列。