code: @Override
      synchronized public void surfaceCreated(SurfaceHolder holder) {
          Log.d(TAG, "surfaceCreated called = " + currentState);
  
          if (this.mediaPlayer != null) {
              this.mediaPlayer.setDisplay(surfaceHolder);
  
              // If is not prepared yet - tryToPrepare()
              if (!this.surfaceIsReady) {
                  this.surfaceIsReady = true;
                  if (this.currentState == State.INITIALIZED ||
                          this.currentState == State.PREPARING)
                      tryToPrepare();
              }
          }
      }
docs: SurfaceView methods