My activity has a menu that inflates on my emulator when I use its hardware “Menu” button, however when I run the app on my actual phone (Galaxy Nexus with 4.0.1) I cant work out a way to make the “3 dot” style menu button appear as it does in some apps. The way that I’ve implemented my menu is:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.wcoptions, menu);
return (super.onCreateOptionsMenu(menu));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.ooptions:
// open preferences activity
startActivity(new Intent(this, WorkCalcPreferenceActivity.class));
break;
case R.id.oquit:
finish();
break;
}
return super.onOptionsItemSelected(item);
}
Also in my manifest file I have the minSDK set as 8 and the targetSDK set as 15.
This is my first app and Im still learning how to implement all these things so any help would be greatly appreciated 🙂
Edit: Here is menu.wcoptions
<item
android:id="@+id/ooptions"
android:icon="@drawable/ic_menu_settings"
android:title="Options"/>
<item
android:id="@+id/oquit"
android:icon="@drawable/ic_menu_exit"
android:title="Quit"/>
If you target Honeycomb or above you won’t get the menu button. The menu button is only there for legacy purposes, and you should instead make use of the action bar or some other means of bringing up the menu.