EDIT, Changed the code slightly based on answers below, but still haven\'t got it working. I also added a log message to tell me if getCount was returning > 0, and i
As paxdiablo said, the cursor will not be null. What you can do is try like this:
if (cur != null && cur.getCount() > 0){
// do nothing, everything's as it should be
}
EDIT
Actually i had used the db.query() and it worked for me. I did this.
cursor = db.query(TABLE_NAME, new String[] { KEY_TYPE }, null, null, null, null, null);
if (cursor != null && cursor.getCount() > 0)
{
retVal = true;
}
TABLE_NAME is my table and KEY_TYPE was my columnname