title: Why Camera needs to be released in onPause() rather than onstop() method of Activity?
body: <p>I seem to be missing something as I fail to understand why in Android documentation <a href="http://developer.android.com/guide/topics/media/camera.html" rel="nofollow">(Android Camera doc. link)</a> it is recommended to release Camera object (as well as MediaRecorder) in onPause() Activity callback? Activity still might be visible by that time and Camera might be running preview so why the Camera object would be released in onPause() rather then onStop() when activity is already hidden? I understand that MediaRecorder object could be stopped in onPause() but Camera itself doesn't make sense to me. What am I missing here? Piece of code from Android documentation is below (its under Releasing the Camera heading):</p>
  
  <pre><code>    @Override
  protected void onPause() {
      super.onPause();
      releaseMediaRecorder();       // if you are using MediaRecorder, release it first
      releaseCamera();              // release the camera immediately on pause event
  }
  
  private void releaseMediaRecorder(){
      if (mMediaRecorder != null) {
          mMediaRecorder.reset();   // clear recorder configuration
          mMediaRecorder.release(); // release the recorder object
          mMediaRecorder = null;
          mCamera.lock();           // lock camera for later use
      }
  }
  </code></pre>