0
我編寫了一個程序來捕捉屏幕觸摸事件。但是當屏幕關閉時,我無法獲得任何MotionEvent ev
。如何在Android屏幕關閉時捕獲屏幕觸摸事件?
private PowerManager pm = null;
private PowerManager.WakeLock wl = null;
this.pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
this.wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "test");
wl.acquire();
@Override
public boolean dispatchTouchEvent (MotionEvent ev) {
if(ev.getAction() == MotionEvent.ACTION_DOWN)
Log.i("test", "!!!");
return true;
}