Updating/deleting a Todo item

What if the user made a mistake entering the new task? We need to provide a way for them to be able to edit a list item, or completely delete that item. We can provide menu items that are only displayed when the user clicks an item. The menu items will give the user the opportunity to either edit or delete the item in question.

If the user chooses the edit option, we will display our task dialog with the task field prefilled for the user to make the required changes.

Let's start by adding the following set of strings to the strings.xml resource file:

<string name="update_task_dialog_title">Edit Task</string>
<string name="edit">Edit</string>
<string name="delete">Delete</string>

The next thing we need to do is to add a menu to our UI. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset