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!
Fortunately, this is not possible.