Detect power button long press

前端 未结 11 2295
轮回少年
轮回少年 2020-11-27 18:38

I\'ve been reading some posts here on Stackoverflow, and I didn\'t find a good solution, I\'m wondering if it\'s possible to detect when the user long press the power button

11条回答
  •  难免孤独
    2020-11-27 19:01

    From Skizo-ozᴉʞS question, what I understand, you actually want to prevent the behavior of the power button and that can't be done. just like the home button pressed some events in android can't be prevented to avoid people having apps they can't quit.

提交回复
热议问题