2

I haven't been keeping up with Android phone evolution since I've gotten a (lame) WP8 work-phone. Apparently, the dedicated Menu key on newer devices is being phased out in favor of something called a Multitasking button.

Example: Samsung Galaxy S5 enter image description here

As the image points out, you can still use this button as a Menu button, but I'd like to call a function directly from a single press. Is there a KeyEvent constant that corresponds with this button?

Snailer
  • 3,777
  • 3
  • 35
  • 46

1 Answers1

1

Is there a KeyEvent constant that corresponds with this button?

Yup!

http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_APP_SWITCH

Veselin Romić
  • 703
  • 6
  • 11
  • Are you sure this is actually capturable? This comment (http://stackoverflow.com/questions/8579818/hw-to-capture-app-switch-key-using-onkeydown-in-android#comment10640004_8579910) suggests it isn't, and I don't have a device to test with. – Snailer Jul 26 '14 at 14:29
  • Hm, I've never tried it, but after a bit of research it looks like it isn't possible. It looks like there's an API in Android L that allows you to lock the user into the app, though, which might accomplish what you're looking for. http://stackoverflow.com/questions/12039004/how-to-ignore-button-click-of-recent-activity-button-in-android-3-0 – Veselin Romić Jul 26 '14 at 14:33