任何人都能告诉我当设备被锁定时如何在日志中打印? 我只想在设备锁定时按音量键打印日志。
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP)
{
Log.w("LightWriter", "I WORK BRO.");
return true;
}
return super.onKeyLongPress(keyCode, event);
}