Inside the startCameraX function when I wrote the statement: preview.setSurfaceProvider(mainBinding.pvPreview.getSurfaceProvider()); I got an error saying, 'Cannot resolve symbol 'mainBinding''. Is there something that I have missed out in my code?
Thanks for trying out the code. Yes, you are missing the mainBinding variable initialization. Here are the things to check: 1) Verify that viewBinding is enabled in build.gradle 2) Initialize mainBinding in the activity and pass its root view in setContentView method.
In build.grade add in android { viewBinding { enabled = true } } and in your class put this private ActivityCameraTimestampBinding mainBinding; but the name its because my xml are activity_camera_timestamp do something similar to your name.xml.
wow thank you so much. You guys are real mentors. I really needed the Camera X API for my recent project. Again Thank You.
great tutorial
If you disable the button for capturing video when recording starts, how is it clickable when it is time to stop recording?
thanks for this ❤
Inside the startCameraX function when I wrote the statement: preview.setSurfaceProvider(mainBinding.pvPreview.getSurfaceProvider()); I got an error saying, 'Cannot resolve symbol 'mainBinding''. Is there something that I have missed out in my code?
Thanks for trying out the code. Yes, you are missing the mainBinding variable initialization. Here are the things to check:
1) Verify that viewBinding is enabled in build.gradle
2) Initialize mainBinding in the activity and pass its root view in setContentView method.
In build.grade add in android { viewBinding {
enabled = true
} }
and in your class put this private ActivityCameraTimestampBinding mainBinding; but the name its because my xml are activity_camera_timestamp do something similar to your name.xml.
@@brunop_dev_jr thanks
@@CodingReel thanks