Skip to content Skip to sidebar Skip to footer

Java.lang.runtimeexception, Setparameters Failed In Android(4.1.1) Version

I have developed an application which captures a photo when punch in at the time. It's working good on Acer tab(capturing image and saves in sdcard). Now when I run the same applic

Solution 1:

Call the startPreview method before you call takePicture method camera.takePicture(null, null, mCall); and the startPreview method I used is

privatevoidstartPreview() {
        if (cameraConfigured && camera!=null) {
          camera.startPreview();
          inPreview=true;
        }
      }

and through this I solved my issue... It may help you guys.

Solution 2:

Solution 3:

privatevoidflipBackToFrontCamera() {

    if (mCamera != null) {
        mCamera.stopPreview();
        mCamera.release();
        mCamera = null;
    }

    mCamera = Camera.open(1);

    if (mCamera != null) {
        try {
            mCamera.setPreviewDisplay(surfaceView.getHolder());
            mCamera.startPreview();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Post a Comment for "Java.lang.runtimeexception, Setparameters Failed In Android(4.1.1) Version"