Open main menu

CDOT Wiki β

Changes

Teams Winter 2011/team1/Android/Add Options Menu

756 bytes added, 14:44, 25 March 2011
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>
1
edit