I’m writing an android application (sdk 8 to 15) and I’m dealing with the menu. I read a lot of things on it to understand, but I ‘m stuck on one point :
Apparently since sdk 10, hardware menu button isn’t supported, now we have to use the action bar. Ok. But in my app I want to have this kind of menu :

Or this :

… which are not hardware menu button but seems to be ‘native action bar’. All I can find on the web is an action bar on the top, with the title of the app and a logo on the left.. which take a lot of place.
I’m so lost with all those sdk versions and I just want to integrate a simple menu like above, how should I proceed ?
I have this in my code, but :
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_fragments_slider, menu);
return true;
}
… but no menu appears with android 4 as it should be in the first or second image.
Check out the Menu Resource in the Android API Documentation and especially:
The example XML from the documentation is a good resource also for exactally how to lay it out:
You then need to add to your Manifest:
That will move your buttons down to the bottom, leave the title in the actionbar and if you have more than what can fit in the screen you get the little three dot | on the right of the lower actionbar. This only really works in Portrait mode though, unless you have quite a few menu items… or longer text strings (I think…)