private void addNote() { String noteText = editText.getText().toString(); editText.setText(""); DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); String comment = "Added on " + df.format(new Date()); Note note = new Note(); note.setText(noteText); note.setComment(comment); note.setDate(new Date()); notesBox.put(note); Log.d(App.TAG, "Inserted new note, ID: " + note.getId()); }
private void addNote() { String noteText = editText.getText().toString(); editText.setText(""); DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); String comment = "Added on " + df.format(new Date()); Note note = new Note(); note.setText(noteText); note.setComment(comment); note.setDate(new Date()); notesBox.put(note); Log.d(App.TAG, "Inserted new note, ID: " + note.getId()); }
private void addNote() { String noteText = editText.getText().toString(); editText.setText(""); DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); String comment = "Added on " + df.format(new Date()); Note note = new Note(); note.setText(noteText); note.setComment(comment); note.setDate(new Date()); notesBox.put(note); Log.d(App.TAG, "Inserted new note, ID: " + note.getId()); }
private void addNote() { String noteText = editText.getText().toString(); editText.setText(""); DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); String comment = "Added on " + df.format(new Date()); Note note = new Note(); note.setText(noteText); note.setComment(comment); note.setDate(new Date()); notesBox.put(note); Log.d(App.TAG, "Inserted new note, ID: " + note.getId()); updateNotes(); }
@Test public void testPutAndGet() { Box<Note> box = store.boxFor(Note.class); Note note = new Note(); note.setText("Hello Desktop"); note.setDate(new Date()); long id = box.put(note); Note noteFromBox = box.get(id); assertEquals("Hello Desktop", noteFromBox.getText()); }