How to make the power off menu disable when I long press the power button?

43 Views Asked by At

I would like not to show the power off menu when I long press the power button while an app I created has been opened/active. I looked up a lot of articles related to this subject but all of them are outdated and did not work.

ACTION_CLOSE_SYSTEM_DIALOGS was deprecated. https://developer.android.com/reference/android/content/Intent#ACTION_CLOSE_SYSTEM_DIALOGS

Can you provide me with some solutions which currently work?

0

There are 0 best solutions below