Teams Winter 2011/team1/Android/Implement Delete Option

From CDOT Wiki
Revision as of 16:07, 25 March 2011 by Azea (talk | contribs) (Created page with '=== 5. Implement Delete Option === 5.1. In the <code>ContactList</code> class add the following lines to the <code>onOptionsItemSelected</code> method: <pre> case R.id.item2:…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

5. Implement Delete Option

5.1. In the ContactList class add the following lines to the onOptionsItemSelected method:

   case R.id.item2:           
            studentList.removeElement((Student)contactsList.getSelectedItem());           
            displayData();
            break;
 

5.2. Run the application, select one student from the list, press menu and select "Delete Student":
A delete1.png
5.3. The list should get updated:
A delete2.png