Monday, 10 June 2019

Prevent my device to turn off when my device is locked

I stuck in little tricky logic. I want to prevent my device to turn off when my device is locked. I am just making an app for antitheft but here is problem that my logic is not working in Pie devices.

That's means after lots of searching on stack overflow. and try lots of code I am still unable to detect of my power key. I tried KEYCODE EVENT but it was use less.

After lots of try from two months Now I am forget that How many answered I have been tried.

Hope fully all of you guys will help me to solve my problem.

Main Problem

How can I prevent my device to turn off when my device is locked. (Specially Pie Devices and above)

You can consider my problem as

I want to disable my device my Power button Long press function when my device is locked

You can also consider my problem as

Override on Power button when my device is locked



from Prevent my device to turn off when my device is locked

No comments:

Post a Comment