how to display camera view and play videoview at a time
<p>I am new to android platform and sorry for asking some questions that may be stupid.
The original idea is to play out a video clip and record video from camera at a time.
My main activity implements SurfaceHolder.Callback to displaying the camera view. I have managed to downsize the view to half of the screen so that my left half of screen is the video from camera.
Then i used videoview to give a play back of a pre-stored video at the right side of the screen. It doesn't work at all (camera frame play back is fine).
Could any people enlight me a little bit? Thanks in advance!!</p>

<pre><code>  @Override
  public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    setContentView(R.layout.main);
    getWindow().setFormat(PixelFormat.UNKNOWN);

    videoview = (VideoView)findViewById(R.id.videoView1);
    videouri = Uri.parse("android.resource:://com.demoxing1/"+R.raw.sample_video);

    surfaceView = (SurfaceView) findViewById(R.id.camera_preview);
    surfaceHolder = surfaceView.getHolder();
    surfaceHolder.addCallback(this);
    surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

    videoview.start();

}

@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
        int height) {

    if (previewing) {
        camera.stopPreview();
        previewing = false;

    }

    if (camera != null) {

        try {
            camera.setPreviewDisplay(surfaceHolder);
            camera.startPreview();
            previewing = true;

        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

@Override
public void surfaceCreated(SurfaceHolder holder) {
    camera = Camera.open();
}

@Override
public void surfaceDestroyed(SurfaceHolder holder) {

    camera.stopPreview();
    camera.release();
    camera = null;
    previewing = false;

}



&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="horizontal"
   android:layout_width="match_parent" android:layout_height="match_parent"&gt;
    &lt;android.view.SurfaceView android:id="@+id/camera_preview"       android:layout_height="wrap_content" android:layout_width="300dp"&gt;   &lt;/android.view.SurfaceView&gt;
  &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="wrap_content"    android:layout_height="match_parent" android:orientation="vertical" android:weightSum="1"&gt;
    &lt;VideoView android:id="@+id/videoView1" android:layout_width="match_parent"    android:layout_height="wrap_content"&gt;&lt;/VideoView&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p></p>

<p>sorry I was out of my computer and I have attached the code. Any help is much appreciated!! Thanks!!</p>
