1

エラーが言ったように、カーソルで日付を取得するための正しいコードが何であるかわかりません:

コンストラクター "Website(int, java.util.String, java.util.String)" を解決できません

私のコンストラクタは次のとおりです。

public Website(int id, Date stamped, String url, String content){
        this._id = id;
        this._stamped = stamped;
        this._url = url;
        this._content = content;
    }

カーソルは次のとおりです。

Website getWebsite(int id) {
            SQLiteDatabase db = this.getReadableDatabase();

            Cursor cursor = db.query(TABLE_WEBSITE, new String[] { KEY_ID,
                            KEY_STAMPED, KEY_URL, KEY_CONTENT }, KEY_ID + "=?",
                    new String[] { String.valueOf(id) }, null, null, null, null);
            if (cursor != null)
                cursor.moveToFirst();

            Website website = new Website(Integer.parseInt(cursor.getDate(0)),
                    cursor.getString(1), cursor.getString(2));
            // return contact
            return website;
        }
4

0 に答える 0