Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black TextureView after navigation #35

Closed
ghost opened this issue Jul 12, 2019 · 3 comments
Closed

Black TextureView after navigation #35

ghost opened this issue Jul 12, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 12, 2019

I use a BottomNavigationView to navigate between my camera fragment and another one.
On the start of my app the camera preview is loaded correctly.
If I navigate to my second fragment and back again, CameraX is successfully bound to the lifecycle, but the TextureView is black.

I can resolve this by adding Thread.sleep(330) before CameraX.bindToLifecycle() but this is a bad solution, because it adds some delay before showing the preview.

What can I do to solve this problem without this delay?

@ghost ghost changed the title Black TextureSurface after navigation Black TextureView after navigation Jul 12, 2019
@owahltinez
Copy link
Contributor

Can you please provide some code that lets us reproduce this issue?

@Tooto
Copy link

Tooto commented Jul 31, 2019

I think, its happen when u rebind camera to lifecycle.
I have black screen os some devices (ex. Alcatel 5059D) when trying to switch between front and back cameras.
I have error in logcat:
E/Camera: CameraDevice.onError(): 1 with error: ERROR_MAX_CAMERAS_IN_USE

@owahltinez
Copy link
Contributor

I think this issue should be at least partially alleviated with alpha04. Please reopen if it still reproduces, and provide specific device and code to reproduce this issue consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants