public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            // Create a RelativeLayout container that will hold a SurfaceView,
            // and set it as the content of our activity.
            mPreview = new Preview (this.Activity);

            // Find the total number of cameras available
            mNumberOfCameras = Camera.NumberOfCameras;

            // Find the ID of the default camera
            Camera.CameraInfo cameraInfo = new Camera.CameraInfo ();
            for (int i = 0; i < mNumberOfCameras; i++) {
                Camera.GetCameraInfo (i, cameraInfo);
                if (cameraInfo.Facing == Camera.CameraInfo.CameraFacingBack) {
                    mDefaultCameraId = i;
                }
            }
            SetHasOptionsMenu (mNumberOfCameras > 1);
        }
Example #2
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            // Create a RelativeLayout container that will hold a SurfaceView,
            // and set it as the content of our activity.
            mPreview = new Preview(this.Activity);

            // Find the total number of cameras available
            mNumberOfCameras = Camera.NumberOfCameras;

            // Find the ID of the default camera
            Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
            for (int i = 0; i < mNumberOfCameras; i++)
            {
                Camera.GetCameraInfo(i, cameraInfo);
                if (cameraInfo.Facing == Camera.CameraInfo.CameraFacingBack)
                {
                    mDefaultCameraId = i;
                }
            }
            SetHasOptionsMenu(mNumberOfCameras > 1);
        }