Android : Ensure Android's Overflow button does not come up on my Actionbar

on Monday, October 27, 2014


I implemented the overflow button myself using the following base XML:



<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="Settings"
android:icon="@drawable/ic_action_overflow"
android:showAsAction="always">
<menu>
<item
android:id="@+id/action_logout"
android:title="Log out"
android:showAsAction="never" />
<item
android:id="@+id/action_offer_advice"
android:title="Advice"
android:showAsAction="never" />
</menu>
</item>

<item
android:id="@+id/action_create"
android:title="Create"
android:icon="@drawable/ic_action_new"
android:showAsAction="always"/>



</menu>


I did this because I want the Overflow button to be on every Android device regardless of a physical menu button. I opted for this over the hacky solution offered many times across Stackoverflow. That being said, I'm a bit fuzzy with ActionBars and I want to be positive that Android's default overflow won't show up for users that don't have a physical menu button. It would be very awkward to have my implementation of the overflow button with Android's default one right next to it.


Am I worrying over nothing? Is this a legitimate concern? If it is a legitimate concern, what could I do to handle that?


0 comments:

Post a Comment