I am beginner , i wrote these codes for option menu , but in new Phones like Nexus4 menu option key does not appear (it should appear near back key on bottom of screen).
my codes :
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
and
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu1:
menu1_action();
return false;
default:
return super.onOptionsItemSelected(item);
}
}
and
<?xml version="1.0" encoding="utf-8"?>
<item
android:id="@+id/menu1"
android:icon="@drawable/menu1
android:showAsAction="ifRoom"
android:title="@string/menu1"/>
what's the problem?
ActionBar
andOverflow
menu. You can't make the button show if the device doesn't have one – VerbeniaActionBar
like a context menu. Here's more info on that: developer.android.com/guide/topics/ui/menus.html – Winograd