mercredi 3 juin 2015

NullPointerException at the first line at getReadableDatabase

I am getting a nullpointer exception at getReadbleDatabase

public List<Offer> getOffers(String offer_category)
    {
        db = this.getReadableDatabase();
        String sql = "select * from offer_db "+TABLE_OFFER + " where "+ OFFER_CATEGORY+ " is "+ offer_category;
        Cursor cur = db.rawQuery(sql,null);
        cur.moveToFirst();
   }

Aucun commentaire:

Enregistrer un commentaire