I\'m using ActionBarCompat in my app, an I want to show one or two items in the action bar
I follwed the guide of google developers, but when I test it, the items are sh
I had the same problem, and found two solutions:
In the menu xml (Login.xml), use your app name for the showAsAction tag:
instead of:
use:
I suppose your application's name is shady.
the second solution for me, on the activity class, at the onCreateOptionsMenu()
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(
getMenuInflater().inflate(R.menu.main, menu);
MenuItem registerMenuItem = menu.findItem(R.id.action_register);
registerMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); // change this in backcompat
return true;
}
if you are using backCompatibility, change last line:
MenuItemCompat.setShowAsAction(registerMenuItem,MenuItemCompat.SHOW_AS_ACTION_ALWAYS);