Bug at CameraXBasic example : camera switch
See original GitHub issueWhen calling bindCameraUseCases at camera_switch_button
click listener, it doesn’t work correctly with Galaxy S10+, Note 8
If I add CameraX.unbindAll()
code to bindCameraUseCases()
function at start line, it works normarlly.
private fun bindCameraUseCases() {
CameraX.unbindAll()
...
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
CameraXBasic crash on Android 9.1 ... - Issue Tracker
When I run CameraXBasic, I can observe a series of internal/managed exceptions up to this code: /** Initialize CameraX, and prepare to bind...
Read more >Android-CameraX: Switch between multiple front cameras
When you bind use cases, CameraX chooses the first camera that meets the use cases requirements. For example, 2 different back cameras may...
Read more >Camera screen turns black while opening camera and go to ...
when user came back to camera activity by pressing back button user seeing black preview. This is only reproduce in Redmi Note 8....
Read more >Facebook bug shows camera activated in background ... - CNET
Some people have complained their cameras got turned on while they were looking through Facebook's app.
Read more >CameraX overview - Android Developers
CameraX is a Jetpack library, built to help make camera app development easier. For new apps, we recommend starting with CameraX.
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 FreeTop 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
Top GitHub Comments
OK, the problem is that when the camera switch button is pressed, we are trying to bind all camera use cases without unbinding the previous ones first. Thanks for flagging!
I think that the proper solution here would be to call
CameraX.unbindAll()
inside of the switch button callback, rather than inside of thebindCameraUseCases()
function.@owahltinez Yes. When I press the switch button, 100%. - Galaxy S10+ confirmed
In logcat, error occurred just one time with this message
After this, error message doesn’t shown and only this message has logged when press switch button.
And if I add
CameraX.unbindAll()
tobindCameraUseCases()
function, it works properly without any error message