Trying to extend class with SQLiteOpenHelper, but this error shows up : "There is no default constructor available in android.database.sqlite.SQLitepenhelper" along with other "cannot resolve symbol Category, Note,..."
class DbHelper extends SQLiteOpenHelper {
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(Category.getSql());
db.execSQL(Note.getSql());
db.execSQL(Attachment.getSql());
db.execSQL(CheckItem.getSql());
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + Category.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + Note.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + Attachment.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + CheckItem.TABLE_NAME);
onCreate(db);
}
Aucun commentaire:
Enregistrer un commentaire