I'm trying to inflate the action bar in my activity with some simple itemes in the onCreateOptionsMenu method but it doesn't work. It simply shows me the action bar with just the name of the activity, without any items.
Here is my xml menu code(ringtones.xml):
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="activities.RingtonesActivity" >
<item android:id="@+id/action_add"
android:icon="@drawable/add"
android:title="@string/action_add_ringtone"
android:showAsAction="ifRoom" />
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
android:showAsAction="never"/>
</menu>
And here is my implementation for onCreateOptionsMenu:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.ringtones, menu);
return true;
}
And here is an image of the action bar:
Also, I extend the "ActionBarActivity" class. What am I doing wrong here?
Edit: I have just noticed that even if I return false in onCreateOptionsMenu, the action bar is still displayed as it is! What is going on?