问题
I want to do something like this-
1.Override the default action of the menu key long press (i.e. launching soft keyboard).
2.Whenever user long presses the menu key, my application will be launched.
3.Moreover, my application may not need to be in the foreground, i.e. even if someone long presses menu key from any other application my application should be launched.
Is this at all possible? How?
回答1:
Is this at all possible? How?
By making your own firmware, where you add this capability to the operating system, and by deploying your custom firmware on your own personal phone (and the phones of anyone else you can convince to run it).
This is not possible for a regular Android SDK application.
回答2:
Yes you can, just root your device (with Cyanogenmod for example) and go to Settings, Cyanogenmod settings, and Input settings. You will find the option there. Instructions for rooting the G2x can be found here: http://forum.xda-developers.com/showthread.php?t=1039985
来源:https://stackoverflow.com/questions/10530517/override-menu-key-long-press-and-launch-an-application-on-long-press