Exemplo n.º 1
0
 @Override
 public void surfaceCreated(SurfaceHolder holder) {
   synchronized (thread) {
     thread.setRunning(true);
     if (!thread.isAlive()) {
       thread.start();
     }
     thread.notify();
   }
 }
Exemplo n.º 2
0
 @Override
 public void surfaceDestroyed(SurfaceHolder holder) {
   synchronized (thread) {
     thread.setRunning(false);
     try {
       thread.wait();
     } catch (InterruptedException e) {
     }
   }
 }
Exemplo n.º 3
0
 public void doTouch(MotionEvent event) {
   if (event.getAction() == MotionEvent.ACTION_DOWN) {
     thread.doTouch(event.getX() / getWidth());
   }
 }