title: Mediarecorder start failed 19
body: <p>my code working android 2.33 but android 4.11 catching error mediarecorder start failed 19 in mediarecorder.start() line why this i don't understand</p>
  
  <pre><code>8-17 18:07:57.468  11453-11453/com.example.SelfVideocaptureTest E/MediaRecorderJNI﹕ Application lost the surface
  08-17 18:08:24.577      89-3117/? E/CameraSource﹕ Camera connection could not be established.
  08-17 18:08:24.577  11453-11453/com.example.SelfVideocaptureTest E/MediaRecorder﹕ start failed: -19
  08-17 18:08:24.581  11453-11453/com.example.SelfVideocaptureTest E/AndroidRuntime﹕ FATAL EXCEPTION: main
      java.lang.RuntimeException: start failed.
              at android.media.MediaRecorder.start(Native Method)
              at com.example.SelfVideocaptureTest.MyActivity.onClick(MyActivity.java:146)
              at android.view.View.performClick(View.java:4084)
              at android.view.View$PerformClick.run(View.java:16966)
              at android.os.Handler.handleCallback(Handler.java:615)
              at android.os.Handler.dispatchMessage(Handler.java:92)
              at android.os.Looper.loop(Looper.java:137)
  </code></pre>
  
  <p>Who can help me ??? It's my code </p>
  
  <p>private boolean prepareVideoRecorder()
              {</p>
  
  <pre><code>            mediaRecorder = new MediaRecorder();
  
              if (Build.VERSION.SDK_INT &lt; 14)
                      camera.unlock();
              mediaRecorder.setCamera(camera);
              mediaRecorder.setPreviewDisplay(preView.getHolder().getSurface());
              mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
              mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
  
              mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
              mediaRecorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).getAbsolutePath());
              mediaRecorder.setPreviewDisplay(preView.getHolder().getSurface());
              try
                  {
                      mediaRecorder.prepare();
                  } catch (IOException e)
                  {
                      e.printStackTrace();
                      releaseMediaRecorder();
                      return false;
                  }
              return true;
          }
  
      @Override
      public void onClick(View view)
          {
              if (isRecording)
                  {
                      mediaRecorder.stop();
                      releaseMediaRecorder();
                      if (Build.VERSION.SDK_INT &lt; 14)
                          camera.lock();
                      button.setText("Capture");
                      isRecording = false;
                  } else if (prepareVideoRecorder())
                  {
                      mediaRecorder.start();
                      button.setText("Stop");
                      isRecording = true;
                  } else
                  {
                      releaseMediaRecorder();
                      Toast.makeText(getBaseContext(), "cannot record", 0).show();
                  }
          }
  </code></pre>
  
  <p>I saw these pages</p>
  
  <ul>
  <li><a href="https://code.google.com/p/google-glass-api/issues/detail?id=360" rel="nofollow noreferrer">https://code.google.com/p/google-glass-api/issues/detail?id=360</a></li>
  <li><a href="https://stackoverflow.com/questions/11249642/mediarecorder-start-failed-19">Mediarecorder start failed -19</a></li>
  <li><a href="https://stackoverflow.com/questions/10496969/android-mediarecorder-start-failed-19">Android MediaRecorder - &quot;start failed: -19&quot;</a></li>
  <li><a href="https://stackoverflow.com/questions/18434178/android-mediarecording-error-start-failed-19-runtimeexception">Android mediarecording error start failed -19 runTimeException</a></li>
  <li><a href="https://stackoverflow.com/questions/23972016/mediarecorder-start-failed-19-and-camera-error-100-android">MediaRecorder start failed -19 and Camera error 100</a></li>
  <li><a href="https://stackoverflow.com/questions/13734406/android-capture-video-mediarecorder-start-failed-19">Android Capture video mediaRecorder.start() failed -19</a>
  But non of them worked for me...</li>
  </ul>