我编写了一个程序来捕获屏幕触摸事件。但是当屏幕关闭时,我无法获得任何MotionEvent ev
.
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;
}