I am trying to create a custom menu button as an Action item, here is the xml resource I used
<menu
xmlns:spyder="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/menu_search_customers"
android:title="@string/hello_world"
android:icon="@android:drawable/ic_menu_search"
spyder:showAsAction="ifRoom|collapseActionView"
spyder:actionViewClass="android.support.v7.widget.SearchView" />
<item
android:id="@+id/menu_overflow"
android:icon="@drawable/abc_ic_menu_moreoverflow_normal_holo_light"
android:orderInCategory="11111"
spyder:showAsAction="always">
<menu>
<item
android:id="@+id/menu_overflow_item1"
spyder:showAsAction="never"
android:title="Item1"/>
<item
android:id="@+id/menu_overflow_item2"
spyder:showAsAction="never"
android:title="Item2"/>
</menu>
</item>
</menu>
And here is the output
Menu popups when i click on action item as expected, I want to popup it on Hardware Menu button click also. is that possible?
You can capture the hardware menu click using the following function.