mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
implement deleting notes
This commit is contained in:
@ -65,9 +65,9 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
db.insert(TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
public void insertNote(Note note) {
|
||||
public int insertNote(Note note) {
|
||||
final ContentValues values = fillContentValues(note);
|
||||
mDb.insert(TABLE_NAME, null, values);
|
||||
return (int) mDb.insert(TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
private ContentValues fillContentValues(Note note) {
|
||||
@ -77,6 +77,10 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void deleteNote(int id) {
|
||||
mDb.delete(TABLE_NAME, COL_ID + " = " + id, null);
|
||||
}
|
||||
|
||||
public boolean doesTitleExist(String title) {
|
||||
final String cols[] = {COL_ID};
|
||||
final String selection = COL_TITLE + " = ?";
|
||||
|
Reference in New Issue
Block a user