Using this Exemple I get sometimes the error
I use the original example (V1.30), only I removed the code to another activity and call this activity in Main with Button "Start Record".
It seems to be something with a destroyed view, because this error happens only sometimes, when starting the Record Activity, but I could not fix it yet.
'java.lang.IllegalArgumentException: surfaceTexture must not be null
B4X:
Public Sub PrepareSurfaceForVideo (MyTaskIndex As Int, Dir As String, FileName As String) As ResumableSub
If MyTaskIndex <> TaskIndex Then Return False
CloseSession
Wait For (CreateSurface) Complete (Result As Boolean)
If MyTaskIndex <> TaskIndex Then Return False
File.Delete(Dir, FileName)
MediaRecorder = Camera.CreateMediaRecorder(PreviewSize, Dir, FileName)
MediaRecorder.RunMethod("setOrientationHint", Array(GetHintOrientation))
Camera.StartSession(tv, PreviewSize, CaptureSize, 0, 0, True) 'ToDo: java.lang.IllegalArgumentException: surfaceTexture must not be null
Wait For Camera_SessionConfigured (Success As Boolean)
If MyTaskIndex <> TaskIndex Then Return False
Return Success
End Sub
It seems to be something with a destroyed view, because this error happens only sometimes, when starting the Record Activity, but I could not fix it yet.