【问题标题】:Detect power button pressed in Accessibility Service检测无障碍服务中按下的电源按钮
【发布时间】:2019-03-22 13:42:17
【问题描述】:

我需要在长按电源和音量+按钮时打开应用程序。 是否可以在辅助功能服务中检测到电源按钮按下?或者可能存在另一种方式来做到这一点?

【问题讨论】:

    标签: android android-service accessibility


    【解决方案1】:

    您可以在onKeyEvent() 方法上检测到音量按钮向上或向下,但由于android 功能,您无法检测到电源按钮。

    【讨论】:

      猜你喜欢
      • 2020-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-15
      相关资源
      最近更新 更多