I use two devices for testing my app:
- Phone(Android 4.0.3). It has a hardware button menu
- Tablet(Android 4.2.2). It has no hardware button menu.
This is code my ToolBars
<ToolbarItems >
<ToolbarItem Text="Action1" Order="Primary" />
<ToolbarItem Text="Action2" Order="Secondary" />
<ToolbarItem Text="Action3" Order="Secondary" />
</ToolbarItems>
When I run app on the phone button with secondary items not showing.
I need to press the menu button that would showing secondary items.
When I run app on the tablet button with secondary items showing. This is normal?
I tried to use this code:
ViewConfiguration config = ViewConfiguration.Get(this);
Field menuKeyField = config.Class.GetDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null)
{
menuKeyField.Accessible = true;
menuKeyField.SetBoolean(config, false);
}
I first run app on the phone button with secondary items not showing. Second and other run - button with secondary items showing.
But this hack. The default behavior of the application is that normal? What do you do in this case?