Software Archive
Read-only legacy content
17060 Discussions

Show Android Menu button on tablet

Yu_B_2
Beginner
919 Views

My phone has physical Menu button and I can capture event with Intel XDK, but on my tablet Asus Memopad 7 by default Menu button is hidden, how I can display it on bottom of screen ?

0 Kudos
4 Replies
PaulF_IntelCorp
Employee
919 Views

I'm not 100% clear what you mean by hidden, I'm guessing that the app is running "full screen" so that you cannot see the back, home and recent apps buttons? If that is the case, you need to swipe your finger up from the bottom or down from the top to reveal those items. In Android tablets (and some newer phones) the "hard menu" button is gone, newer Android devices and tablets use "soft menu" buttons.

0 Kudos
Yu_B_2
Beginner
919 Views

My phone (Sony Ericsson Xperia Arc S, Android 4.0.4) has 3 hardware physical keys: "Back", "Home" and "Menu". I successfully can capture events of pressing "Back" or "Menu" using Intel XDK:

document.addEventListener("menubutton", onMenuKeyDown, false);

document.addEventListener("backbutton", backBtn, false); 

All works perfect on my phone, but my tablet (Asus MemoPad 7 ME173X, Android 4.2.2) has no hardware physical buttons, it displays on bottom of touchscreen (action bar) by default 3 buttons: "Back", "Home" and "Task manager", and sometime it shows "Menu" button (Overflow menu) at right bottom corner, possible when current app requested this button. The event listener of my app works, but "Menu" (or Overflow) button is not shown on Android's action bar at bottom of screen. 

I installed "Cordova-Mega-Demo" (year 2013) from Google Play ( https://play.google.com/store/apps/details?id=au.com.redata.android.demo ) , it demonstrates Menu-button capture and it displays this button on my tablet, all works fine, but I dont know how. This demo contains these lines at end of AndroidManifest.xml: 

<application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity android:name=".CordovaAndroidActivity"
                  android:configChanges="orientation|keyboardHidden|keyboard|screenLayout|locale" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

 

Do you think  that if I add these lines to my app then Menu button will be displayed ? 

Thank you !

0 Kudos
PaulF_IntelCorp
Employee
919 Views

When using the older Sony device, with Android 4.0, do you actually see anything in the menu button when you press it in an app that you've built? Typically, Cordova apps don't populate that menu with anything useful. On the newer device, unless you've got a list of menu items, there isn't going to be an overflow menu, so there won't be anything on which to capture events...

0 Kudos
Yu_B_2
Beginner
919 Views

In my code I have alert("menu pressed") in event listener and it works.

0 Kudos
Reply