쓰레드가 10초정도는 반복작업을 하다가

갑자기 하던 동작을 멈추네요 쓰레드는 계속 돌고 있는 듯한데...

 

event1 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 400, 180, 0);
    event2 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, 400, 180, 0);

    event3 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 400, 450, 0);
    event4 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, 400, 450, 0);

    event5 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 400, 760, 0);
    event6 = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, 400, 760, 0);

 

이 이벤트를

 

th = new MyThread();
    th.setDaemon(true);
    th.start();

 

class MyThread extends Thread {
  public void run() {
   try {
    while (!stop) {
     Thread.sleep(500);
     new Instrumentation().sendPointerSync(event1);
     new Instrumentation().sendPointerSync(event2);
     new Instrumentation().sendPointerSync(event3);
     new Instrumentation().sendPointerSync(event4);
     new Instrumentation().sendPointerSync(event5);
     new Instrumentation().sendPointerSync(event6);
    }
   } catch (InterruptedException e) {
   } catch (Exception e) {
   }
  }
 }

 

형식으로 계속 해당좌표에 MotionEvent가 발생되도록 하는데

 

한 10초뒤에 그 동작이 멈추네요...

 

어떻해 된걸까요. 도와주세요 고수님들.