I started working with the new camera2 API.
I run a camera preview on a TextureView
in my first Activity. Via my navigation drawer can I start a second Activity. I want this one to show me a camera preview in a TextureView
, too. Unfortunately, the screen stays white and I don't see a picture. I don't know the error and couldn't find something about it:
5278-5414/de.application E/CameraDeviceGLThread-0﹕ Received exception on GL render thread:
java.lang.IllegalStateException: swapBuffers: EGL error: 0x300d
at android.hardware.camera2.legacy.SurfaceTextureRenderer.checkEglError(SurfaceTextureRenderer.java:487)
at android.hardware.camera2.legacy.SurfaceTextureRenderer.swapBuffers(SurfaceTextureRenderer.java:480)
at android.hardware.camera2.legacy.SurfaceTextureRenderer.drawIntoSurfaces(SurfaceTextureRenderer.java:681)
at android.hardware.camera2.legacy.GLThreadManager$1.handleMessage(GLThreadManager.java:103)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:211)
at android.os.HandlerThread.run(HandlerThread.java:61) 06-01 23:00:44.258 5278-5414/de.application I/CameraDeviceState﹕ Legacy camera service transitioning to state ERROR
I start the new Activity pretty simple, and the functions for the camera are in both Activitys more or less the same.
Intent i = new Intent(MainActivityOld.this, FullScreenActivity.class);
startActivity(i);
Can you imagine a mistake I make? Do I have to stop the first Camera Preview somehow?