Last active
February 2, 2020 12:50
-
-
Save thanhnh98/410a9ac6746f89fee609104f56233ce6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Note getNote(int id) { | |
SQLiteDatabase db = this.getReadableDatabase(); | |
Cursor cursor = db.query(TABLE_NOTE, new String[] { COLUMN_NOTE_ID, | |
COLUMN_NOTE_TITLE, COLUMN_NOTE_CONTENT }, COLUMN_NOTE_ID + "=?", | |
new String[] { String.valueOf(id) }, null, null, null, null); | |
if (cursor != null) | |
cursor.moveToFirst(); | |
Note note = new Note(Integer.parseInt(cursor.getString(0)), | |
cursor.getString(1), cursor.getString(2)); | |
return note; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment