简体   繁体   中英

how can I add a special function the android phone's volume button?

My question changed. can I do the same thing using volume button instead? (that is, trigger act2 even when the the phone is sleeping)


Hi I want to write an app making use of the power button. The concept of the app is as follows

Activity1 -->service1-->service2-->service3-->.....-->serviceXX-->Activity2

each class has its won trigger mechanism. what I want to do is: no matter when(whether you started the app or not), press the power button quickly 5 times (5 times in 1 second,not accumulated to 5 times), and it is forced to jump to Activity2. Of course, the original power button function is still maintained, I just want to add an special function to power button. Atfer I stop the app, I want the power function settings stilled memorized by the phone.

Is it possible to do so? Thanks for help!

I want to write an app making use of the power button.

Fortunately, this is not possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM