i want to know about the expression
val videoCapture = this.videoCapture ?: return
especially,
?: return
part.
As far as i know "?" is used for let the variable can be assigned with null. However i cant really find the explanation related with "?: return" expression. I found this expression in google camera basic guide in kotlin. In case you need more code to figure it out.
private fun captureVideo() {
val videoCapture = this.videoCapture ?: return
viewBinding.videoCaptureButton.isEnabled = false
val curRecording = recording
if (curRecording != null) {
// Stop the current recording session.
curRecording.stop()
recording = null
return
}
If anyone knows what ?: return means, please kindly guide me. Thanks.