As the title suggests, I want to put some text in the action bar. Firstly, here's a mockup (in Paint!) of what I'm imagining:
I'm really struggling with this. In my activity I put:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_screen, menu);
return true;
}
And in the menu folder I put main_screen.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/user_level"
android:title="Administrator"
android:showAsAction="withText" />
</menu>
So I have 2 questions:
Question 1
Why at the very least the solution above doesn't show the text Administrator
Question 2
Once it's showing the text, how do I make it appear like a label (with the grey background and the rounded corners, etc)?
Thank you for your help.