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;
}