读取具有表面视图的cameraapi2的相机输出后,应用程序崩溃。
这是获取图像并提交给另一个控制器的代码。
Intent resultIntent = new Intent();
resultIntent.putExtra(ConstKeyVariables.strProfileImage, sImage);
setResult(Activity.RESULT_OK, resultIntent);
}
this.finish();
这是我的SurfaceView
mPreview = new CameraPreviewNew(this, id, CameraPreviewNew.LayoutMode.FitToParent,camera2id);
LayoutParams previewLayoutParams = new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
//mLayout is the container
mLayout.addView (mPreview, 0, previewLayoutParams);
这是我的毁灭
protected void onDestroy() {
Log.e("CameraActivity", "Destroying");
super.onDestroy();
try {
stopCameraPreview();
}catch (Exception ex){
//ignore
}
Log.e("CameraActivity", "Destroyed");
}