i am using actionbar in android but its not showing the overflowbar.i am trying as tutorial but its not working althoough i did the same whats wrong?i just want home to display and the others on overflow.here is the menue codei am using actionbar in android but its not showing the overflowbar.i am trying as tutorial but its not working althoough i did the same whats wrong?i just want home to display and the others on overflow.here is the menue code
<item android:id="@+id/Homebar"
android:title="Home"
android:orderInCategory="1"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/infobar"
android:title="Info"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/servicebar"
android:title="Services"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/onlinetoolsbar"
android:title="Online tools"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/mediacenterbar"
android:title="Media center"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
You are probably using a device with a dedicated menu button, or an emulator with a dedicated menu button. Prior to Android 4.4, Android won't show an overflow button if the devices has a dedicated menu button. If you press the menu button, the overflow menu should appear.
Google changed this behaviour in Android 4.4 Kitkat, and now all devices will show the overflow button. If you're using the emulator, try testing on the Android 4.4 emulator. If you're testing on a real device with a dedicated menu button, use that button to 'summon' the overflow menu.
EDIT: To get a custom submenu/overflow menu, you have to create a seperate menu inside a menuitem. Like this:
<item android:id="@+id/Homebar"
android:title="Home"
android:orderInCategory="1"
android:showAsAction="ifRoom"
>
<menu>
<item android:id="@+id/infobar"
android:title="Info"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/servicebar"
android:title="Services"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/onlinetoolsbar"
android:title="Online tools"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/mediacenterbar"
android:title="Media center"
android:orderInCategory="2"
android:showAsAction="ifRoom"
/>
</menu>
</item>