<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_item"
android:icon="@drawable/item_icon"
android:showAsAction="ifRoom"
android:title="Menu Item"/>
</menu>
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.menu_home, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId())
{
case R.id.menu_item:
Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
return true;
}
return super.onOptionsItemSelected(item);
}