title: Android duplicate SurfaceView
body: <p>I want to create an android app with a surfaceview that fills the left part of the screen and with another second surfaceview that fills the right part of the screen.</p>
  
  <p>In both surfaceviews should be a preview of the camera. So that there are two exactly similar camera pictures side by side.</p>
  
  <p>I tried it like this (i will remove the button and onclick part etc when i solved my surfaceview problem):</p>
  
  <pre><code> getWindow().setFormat(PixelFormat.UNKNOWN);
     surfaceView = (SurfaceView)findViewById(R.id.surfaceview);
     surfaceHolder = surfaceView.getHolder();
     surfaceHolder.addCallback(this);
     surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
     surfaceView2 = (SurfaceView)findViewById(R.id.SurfaceView02);
     surfaceHolder2 = surfaceView2.getHolder();
     surfaceHolder2.addCallback(this);
     surfaceHolder2.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
    buttonStartCameraPreview.setOnClickListener(new Button.OnClickListener(){
  
  @Override
  public void onClick(View v) {
  // TODO Auto-generated method stub
  if(!previewing){
  
   camera = Camera.open();
  
   if (camera != null){
  
     try {
  
         camera.setPreviewDisplay(surfaceHolder);
         camera.setPreviewDisplay(surfaceHolder2);
  
  } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  
     camera.startPreview();
     previewing = true;
  
  
   }
  } 
  }});
  </code></pre>
  
  <p>But obviously it just displays the preview in the "last" surfaceHolder (here: surfaceHolder2). I hope you can help me :)</p>