Exemplo n.º 1
0
 public void surfaceCreated(SurfaceHolder holder) {
   if (m_graphThread.getState() == Thread.State.TERMINATED) {
     m_graphThread = new SpectrumThread(getHolder(), this);
     m_graphThread.setRunning(true);
     m_graphThread.start();
   } else {
     m_graphThread.setRunning(true);
     m_graphThread.start();
   }
   Log.v(TAG, "Created surface");
 }
Exemplo n.º 2
0
  public void surfaceDestroyed(SurfaceHolder holder) {
    boolean retry = true;
    m_graphThread.setRunning(false);

    while (retry) {
      try {
        m_graphThread.join();
        retry = false;
      } catch (InterruptedException e) {
        // Try again...
      }
    }
  }