Can someone tell me, why this code:
Boolean done = db.delete(ACCOUNTS_TABLE, KEY_ROWID, getIds(accounts)) > 0;
return this exception?
05-08 10:09:36.074: E/AndroidRuntime(1955): java.lang.NullPointerException
function return array of strings, so everything should be OK
Solution
before delete a called close() on db
But now it return this exception:
android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException: bind or column index out of range: handle 0x1eef920
If that is indeed the problematic line referred to in the exception, it’s almost certainly because
dbis a null reference, or possibly becausegetIdsthrows the exception.It’s a little difficult to tell without more information but, as a start, I’d be putting in something to dump the
dbvariable out, either beforehaned or as part of antry/catchblock around the call.