Notepad Tutorial - Delete Blank Notes

Put your problem here if it does not fit any of the other categories.

Notepad Tutorial - Delete Blank Notes

Postby runnerpaul » Thu Mar 03, 2011 8:55 pm

Hey,

Im a relatively inexperienced programmer but am trying to get to grips with Android development. I just completed the notepad tutorial at http://developer.android.com/resources/tutorials/notepad/index.html.

I have noticed that its possible to create a blank note but that it then cant be deleted. I thought a good way to learn more would be to attempt the following:

1. Throw an error if the user attempts to commit adding a blank note.
2. Add a feature where its possible to delete blank notes.

If anybody has any ideas where to begin with this or if you know of relevant sites to look at I would be greatful.

Cheers
Paul
runnerpaul
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Mar 03, 2011 8:50 pm

Top

Re: Notepad Tutorial - Delete Blank Notes

Postby Boni2k » Sat Mar 05, 2011 2:28 pm

I guess you're using Notepadv3solution:

1. add "if (body.trim().equals("")) { ERROR }" to the saveState method.
2. if you have the id of the blank note there is a pre exsiting method to delete it in NotesDbAdapter.java. It can be called via mDbHelper.delete(id).
Boni2k
Experienced Developer
Experienced Developer
 
Posts: 88
Joined: Sun Dec 20, 2009 9:46 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 9 guests