how to detect power button event at lock screen android 9.1 honor mobile device

23
August 01, 2019, at 5:10 PM

how to detect power button at lock screen android 9.1 honor mobile device I want to control my power button at lock screen for performing a particular task when the long press of power button in android devices

Answer 1

You might be able to achieve this with a BroadcastReceiver listening for Intent.ACTION_SCREEN_OFF/Intent.ACTION_SCREEN_ON or overriding a dispatchKeyEvent for KeyEvent.KEYCODE_POWER.

READ ALSO
Create an SDK and use it in other android mobile applications

Create an SDK and use it in other android mobile applications

I want to create a SDK in android studio and useit in my other mobile applications

44
How to get Data from Firebase using Kotlin?

How to get Data from Firebase using Kotlin?

I'm trying to get an information ('firstDate') saved in firebase using this code:

30
Can I temporarily stop to open other apps through my app for specific time?

Can I temporarily stop to open other apps through my app for specific time?

i am developing phone addiction Android app in this app i need a functionality don't open particular app for specific time

52