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
When you Create Cursor from the Database you have to first check for both (cursor != null && cursor.moveToFirst())
. In your case if there is no any data available then it will create a problem.
so before you use Cursor add the condition
if(c != null && c.moveToFirst()) {
//write your code here
}
java.lang.IllegalStateException: get field slot from row 0 col -1 failed
Normally this error you will get if you are trying to read a column value from the cursor but that column is not exists in the cursor.