How to handle Android power button events? -
i want create android application opened in background when power button pressed twice.
i want know how can handle power button , choose happens when user press power button?
just have in safety apps sends sos messages on number of power key presses.
first need add following permission
manifest file
:
<uses-permission android:name="android.permission.prevent_power_key" />
it has 2 methods onkeydown()
, onkeylongpress()
@override
these 2 methods performing actions.
Comments
Post a Comment