The whole screen goes black when the Android camera is first called

The first time you call a camera using this code,

    mCamera = getCameraInstance();  // Create an instance of Camera
    // Create our Preview view and set it as the content of our activity.
    mPreview = new CameraPreview(this, mCamera);// Create our Preview view and set it as the content of our activity.
    FrameLayout preview = (FrameLayout) findViewById(R.id.quest_image);
    preview.addView(mPreview);

      

the entire screen goes dark for a moment and then a preview is displayed on the preview screen. All other calls only have a black preview screen and then show a preview. How do I only have the preview screen flashing black even on the first call? Thanks to

+3


source to share





All Articles