Code example for Menu

Methods: add

0
 
	// TODO - add Bundles for these? 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		MenuItem homeItem = menu.add(0, 0, 0, "Home");
		MenuItem aboutItem = menu.add(0, 1, 0, "About");
		homeItem.setIcon(android.R.drawable.ic_menu_edit);
		aboutItem.setIcon(android.R.drawable.ic_menu_info_details);
 
		return true; 
	} 
 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case 0: 
			Intent i = new Intent(Help.this, Home.class);
			if (extras != null) {
				i.putExtras(extras);
			}