Changes

Jump to: navigation, search

Teams Winter 2011/team1/Android/Implement Delete Option

551 bytes added, 15:07, 25 March 2011
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:…'
=== 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:
studentList.removeElement((Student)contactsList.getSelectedItem());
displayData();
break;
</pre>
5.2. Run the application, select one student from the list, press menu and select "Delete Student":<br/>
[[Image: A_delete1.png | 450px]]<br/>
5.3. The list should get updated: <br/>
[[Image: A_delete2.png | 450px ]]
1
edit

Navigation menu