takePicture failed
See original GitHub issuejava.lang.RuntimeException: takePicture failed
at android.hardware.Camera.native_takePicture(Native Method)
at android.hardware.Camera.takePicture(Camera.java:1561)
at com.google.android.cameraview.Camera1.takePictureInternal(Camera1.java:230)
at com.google.android.cameraview.Camera1$2.onAutoFocus(Camera1.java:221)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1199)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5593)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Device: Honor SCL-AL00
OS: EMUI3.1.1(Android 5.1.1)
other problem:call back onPictureTaken
and save picture always.
Camera1.java
@Override
void takePicture() {
if (!isCameraOpened()) {
throw new IllegalStateException(
"Camera is not ready. Call start() before takePicture().");
}
if (getAutoFocus()) {
mCamera.cancelAutoFocus();
mCamera.autoFocus(new Camera.AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
takePictureInternal();
}
});
} else {
takePictureInternal();
}
}
takePictureInternal(); mCamera.cancelAutoFocus(); it is work.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
java.lang.RuntimeException: takePicture failed - Stack Overflow
Declare a flag as a member of your Activity: · In surfaceChanged() , just set the flag to true after calling startPreview(): ·...
Read more >java.lang.RuntimeException: takePicture failed with ... - B4X
Hi all: My workmates use my app to make a lot of pics of their jobs. I use to make the pictures CameraExClass...
Read more >Exception java.lang.RuntimeException: takePicture failed #361
Exception java.lang.RuntimeException: takePicture failed #361. Open.
Read more >Android : java.lang.RuntimeException: takePicture failed
Android : java.lang.RuntimeException: takePicture failed [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Android ...
Read more >takePicture failed when I try to take photos and the application ...
RuntimeException: takePicture failed at android.app.ActivityThread. ... takePicture(Camera.java:1551) at android.hardware.Camera.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@yaraki: I have this issue as well.
Is it fixed, I am facing the same issue