after bootup,crashing

前端 未结 5 1754
轮回少年
轮回少年 2021-01-16 02:40

My application is using a bootup service.In the service i have to get values from a database,but the app is crashing as it tries getting the values...

The logcat err

5条回答
  •  梦谈多话
    2021-01-16 03:37

    The error says that you are trying to receive the string from the column with index -1 which is WRONG. Columns are enumerated starting from 0. As google's doc says about Cursor.getColumnIndex(String name), it returns -1 if the column with "name" name doesn't exist. Check the line 69 of your MyService.java file:

    String num1 = cursor2.getString(cursor2.getColumnIndex("secure"));
    

    I think there is no "secure" column in your database. Verify your database.

提交回复
热议问题