hello,
with the camera library I can take a picture, but if I live my Layout which is in a panel (but not leave the activity), when I want to take a new shot, the last toastMessage at the end of this code appears.
I'm obliged to relaunch my app. What can be wrong, because, I only do a 'visible-non visible' panel (the one which has the camera layout), that is to say that my camera should be always 'on' waiting for a new shot. But the behaviour here seems to indicate that the 'prepareSurface' fails.
Any way to solve this ?
with the camera library I can take a picture, but if I live my Layout which is in a panel (but not leave the activity), when I want to take a new shot, the last toastMessage at the end of this code appears.
camera library:
Sub OpenCamera (front As Boolean)
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission!", True)
Return
End If
SetState(False, False, VideoMode)
Wait For (cam.OpenCamera(front)) Complete (TaskIndex As Int)
If TaskIndex > 0 Then
MyTaskIndex = TaskIndex 'hold this index. It will be required in later calls.
Wait For(PrepareSurface) Complete (Success As Boolean)
End If
Log("Start success: " & Success)
SetState(Success, False, VideoMode)
If Success = False Then
ToastMessageShow("Failed to open camera, relaunch the app !", True)
End If
End Sub
I'm obliged to relaunch my app. What can be wrong, because, I only do a 'visible-non visible' panel (the one which has the camera layout), that is to say that my camera should be always 'on' waiting for a new shot. But the behaviour here seems to indicate that the 'prepareSurface' fails.
Any way to solve this ?