Good evening I am considering creating an application on the android platform an开发者_C百科d I want to know if it is possible to launch an application based on a particular system event, like pressing and holding a specific button for a period of time (i.e. 3 secs and launch application)?
You can map search + a key to open a particular application. See keyboard shortcuts to switch between applications. That is an OS level thing though, I'm not sure what it would have to do with developing your own application.
Inside an activity it's easy, use the Event Handlers combined with the KeyEvent class and launch your preferred activity with an intent.
精彩评论