Open main menu

CDOT Wiki β

Changes

Teams Winter 2011/team1/Android/Add Options Menu

36 bytes added, 11:20, 28 March 2011
no edit summary
[[Image: A_menu3.png | 500px]]<br/>
4.5. In the <code>ContactList</code> class override the <code>onCreateOptionsMenu()</code> method:
<presource lang="java">
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu);
}
</presource>
4.6. Run the application and press the menu button. You should see newly added menu item:<br/>
[[Image: A_menu4.png | 450px]]<br/>
[[Image: A_menu5.png | 450px]]
4.8. Add functionality to the menu items. In <code>ContactList</code> class override the following methods:
<presource lang="java">
@Override
public boolean onOptionsItemSelected(MenuItem item) {
}
</presource>
1
edit