1
edit
Changes
no edit summary
4.7. Repeat the same steps to add Delete Student, View Student and Send Email:<br/>
[[Image: A_menu5.png | 450px]]
4.8. Add functionality to the menu items. In <code>ContactList</code> class override the following methods:
<pre>
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.item1:
//Add Student
break;
case R.id.item2:
//Delete Student
break;
case R.id.item3:
//View Student
break;
case R.id.item4:
//Send e-mail
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
return super.onMenuItemSelected(featureId, item);
}
</pre>