Open main menu

CDOT Wiki β

Teams Winter 2011/team1/Android/Implement Delete Option

Revision as of 15: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)

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":
 
5.3. The list should get updated: