title: Only last photo is saved when using camera.takePicture() multiple times
body: <p>I think that my problem is described quite well in the title.</p>
  
  <p>Basically, what I`m trying to do is this:</p>
  
  <pre><code>takeFocusedPhoto("a");
  doSomethingElse();
  takeFocusedPhoto("b");
  doSomethingElse();
  takeFocusedPhoto("c");
  doSomethingElse();
  takeFocusedPhoto("d");
  </code></pre>
  
  <p>But my code only manage to save the last one (d.jpg). </p>
  
  <p>doSomethingElse() is actualy a function to rotate platform on which my cell phone stands (I want to take picture of every wall in the room.</p>
  
  <p>Is there an easy way to fix this? I`d appreciate any kind of help or suggestion.</p>
  
  <p>The code:</p>
  
  <pre><code>/** Takes photo with default settings */
  public void takePhoto(){
  
      camera.startPreview();
  
      camera.takePicture(null, rawCallback, jpegCallback);
  
      camera.stopPreview();
  
  }
  /** Takes photo using Auto Focus function */
  public void takeFocusedPhoto(String name){
  
      filename=name;
      isAutoFocused=false;
      camera.startPreview();
  
          AutoFocusClbk afcb = new AutoFocusClbk();
          camera.autoFocus(afcb);
  
          if(isAutoFocused){
              Log.d(TAG, "takeFocusedPhoto - AutoFocused");   
          }
          else{
  
              Log.d(TAG, "takeFocusedPhoto - NOT AutoFocused");
  
          }
  
          camera.takePicture(null, rawCallback, jpegCallback);
  
  
      camera.stopPreview();
  
  }
  /** Releases the interface */
  public void closeCamera(){
  
      camera.release();
  
  }
  /** Shutter */
  /*ShutterCallback shutterCallback = new ShutterCallback() {
      public void onShutter() {
          Log.d(TAG, "onShutter'd");
      }
  };*/
  
  /** Handles data for raw picture */
  PictureCallback rawCallback = new PictureCallback() {
      public void onPictureTaken(byte[] data, Camera camera) {
          Log.d(TAG, "onPictureTaken - RAW");
      }
  };
  /** Handles data for jpeg picture */
  PictureCallback jpegCallback = new PictureCallback() {
      public void onPictureTaken(byte[] data, Camera camera) {
          FileOutputStream outStream = null;
          try {
              //write the file to sdcard
              outStream = new FileOutputStream(String.format("/sdcard/"+filename+".jpg"));    
              outStream.write(data);
              outStream.close();
              Log.d(TAG, "onPictureTaken - SUCCESS! - wrote bytes: " + data.length);
          } catch (FileNotFoundException e) {
              Log.d(TAG, "onPictureTaken - FAILURE - FileNotFound");
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
          }
          Log.d(TAG, "onPictureTaken - JPEG");
      }
  };
  /** AutoFocus Callback */
  private class AutoFocusClbk implements Camera.AutoFocusCallback{
  
      public void onAutoFocus(boolean success, Camera camera){
  
          isAutoFocused = success;
          Log.d(TAG, "onAutoFocus - AutoFocused: "+success);
      }
  
  };
  }
  </code></pre>