Dies ist ein Teil meiner Datenbank. Ich folgte der Position der Spalten, aber es ist immer noch ein Fehler.Datenbank Cursor und Fehler mit Spalten
public static final String CREATE_TABLE_NOTE = "create table " + NOTE_TABLE + " ("
+ COLUMN_ID + " integer primary key autoincrement, "
+ COLUMN_TITLE + " text not null, "
+ COLUMN_MESSAGE + " text not null, "
+ COLUMN_THOUGHTS + " text not null, "
+ COLUMN_CATEGORY + " text not null, "
+ COLUMN_DATE + ");";
private Note cursorToNote(Cursor cursor){
//this part is underlined in red(error)
Note newNote = new Note (cursor.getString(1), cursor.getString(2),cursor.getString(3),
Note.Category.valueOf(cursor.getString(4)), cursor.getLong(0), cursor.getLong(5));
return newNote;
}
Note.java
public Note (String title, String message, Category category, long noteId, long dateCreatedMilli){
this.title = title;
this.message = message;
this.thoughts = thoughts;
this.category = category;
this.noteId = noteId;
this.dateCreatedMilli = dateCreatedMilli;
}
Was ist Ihr Fehler? Auch der 'COLUMN_DATE' Typ fehlt. –
Fehler: (112, 24) Fehler: kein geeigneter Konstruktor gefunden für Note (String, String, String, Kategorie, long, long) Konstruktor Note.Note (String, String, Category) ist nicht anwendbar (tatsächliches und formales Argument Listen unterscheiden sich in der Länge) Konstruktor Note.Note (String, String, Kategorie, lang, lang) ist nicht anwendbar (tatsächliche und formale Argumentlisten unterscheiden sich in der Länge) + Misagh –
fehlt von wo + Misagh –