我正在尝试使用前置摄像头,但是却出现了后置摄像头。有什么问题?
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,int height) {
// TODO Auto-generated method stub
if (!previewing)
{
camera = Camera.open();
if (camera != null)
{
try
{
camera.setDisplayOrientation(90);
camera.setPreviewDisplay(surfaceholder);
Camera.Parameters p = camera.getParameters();
p.set("camera_id",2);
camera.setParameters(p);
camera.startPreview();
previewing = true;
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}