Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 619 Bytes

deletion.md

File metadata and controls

16 lines (14 loc) · 619 Bytes

Deletion

There are a bunch of ways to implement deletion. To actually perform it, you can use the following method.

public void deleteNote(int id) {
    // Create a new instance of the NoteTakingDatabase
    NoteTakingDatabase handler = new NoteTakingDatabase(getApplicationContext());
    // Get the writable database
    SQLiteDatabase db = handler.getWritableDatabase();
    // Delete the note from the database
    handler.deleteNote(db, id);
}

Remember, you'll probably want to refresh after you do this.

Note: Remember how you implemented onClickListeners? There's more than just clicking available.