The final job associated with making the list work properly is to code the capability to delete a contact from the list (and the database). This functionality is primarily implemented in the custom adapter. However, because you don’t want the user to accidently delete a contact, the app provides a button to turn the delete functionality on and off. Four tasks need to be completed to implement the delete function:
1. Add a button to the
activity contact_list layout.
2. Code a method to delete a contact from the database in
3. Code the custom adapter to delete a contact from the list and database.
4. Code the
ContactListActivity to use the delete function of the adapter.
First, add the button to the layout ...