Croïd Active Member Licensed User Longtime User Aug 13, 2017 #1 HI, I use this code to divert the focus function but on some devices, but I have a crash ! Is there another solution? Code: Copy Try If camera1.GetSupportedFocusModes.IndexOf("auto") > -1 Then camera1.FocusAndTakePicture Else camera1.TakePicture End If Catch Log(LastException) End Try Attachments crash.txt crash.txt 1.2 KB · Views: 641
HI, I use this code to divert the focus function but on some devices, but I have a crash ! Is there another solution? Code: Copy Try If camera1.GetSupportedFocusModes.IndexOf("auto") > -1 Then camera1.FocusAndTakePicture Else camera1.TakePicture End If Catch Log(LastException) End Try
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2017 #2 Do you have access to this device? Upvote 0
Croïd Active Member Licensed User Longtime User Aug 13, 2017 #3 Erel said: Do you have access to this device? Click to expand... No, Error reports in Google Console ( hct6735m_35gu_l, 0MB RAM, Android 5.1) Upvote 0
Erel said: Do you have access to this device? Click to expand... No, Error reports in Google Console ( hct6735m_35gu_l, 0MB RAM, Android 5.1)
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2017 #4 Try to add a short sleep before the image is taken: Code: Copy 'CameraExClass Private Sub Camera_FocusDone (Success As Boolean) If Success Then Sleep(100) '<----- TakePicture Else Log("AutoFocus error.") End If End Sub Upvote 0
Try to add a short sleep before the image is taken: Code: Copy 'CameraExClass Private Sub Camera_FocusDone (Success As Boolean) If Success Then Sleep(100) '<----- TakePicture Else Log("AutoFocus error.") End If End Sub
Croïd Active Member Licensed User Longtime User Aug 14, 2017 #5 Erel said: Try to add a short sleep before the image is taken: Code: Copy 'CameraExClass Private Sub Camera_FocusDone (Success As Boolean) If Success Then Sleep(100) '<----- TakePicture Else Log("AutoFocus error.") End If End Sub Click to expand... Thank you Erel, I will watch and I will keep you informed Upvote 0
Erel said: Try to add a short sleep before the image is taken: Code: Copy 'CameraExClass Private Sub Camera_FocusDone (Success As Boolean) If Success Then Sleep(100) '<----- TakePicture Else Log("AutoFocus error.") End If End Sub Click to expand... Thank you Erel, I will watch and I will keep you informed
Croïd Active Member Licensed User Longtime User Aug 15, 2017 #6 I think the problem is not solved Attachments crash2.txt crash2.txt 1.1 KB · Views: 668 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 16, 2017 #7 My guess is that it is not related to the focus action. You can catch this error with a try / catch block and inform the user that it failed to capture a picture. There isn't any other information there that can help. Upvote 0
My guess is that it is not related to the focus action. You can catch this error with a try / catch block and inform the user that it failed to capture a picture. There isn't any other information there that can help.