Android Question StartActivity from Camera2's Activity stops the video preview

peacemaker

Expert
Licensed User
Longtime User
HI, All

Creating the new thread, as a rule.
If to try to open any other activity by StartActivity - Camera2 sample in video mode stops the video preview, and (when go back to the Main camera activity) it cannot be reset until the app full restart.
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
LIMITED
Start success: true
/storage/emulated/0/Folder/1554467032966_2019.04.05_16-23-52.mp4
** Activity (main) Pause, UserClosed = false **
Ignoring event: camera_previewcapturecomplete
** Activity (main) Resume **
LIMITED
Start success: true
Event camera_previewcapturecomplete is always ignored.

Any heeelp...
 

peacemaker

Expert
Licensed User
Longtime User
My old first project (where i moved the code from your sample into my project) is still with this trouble, but the new remade version basing on your example (where i moved my code into your example) is OK for the preview restoring at Release.

Anyway the events "camera_previewcapturecomplete" is always ignored when StartActivity, but going back is correct in your sample. No idea what is the difference.
But solved, thanks.
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
I know it's an old thread, but same problem here and maybe this were the solution. My problem was I forgot the cam.stop in Activity_Pause
B4X:
Sub Activity_Pause (UserClosed As Boolean)
    cam.Stop
End Sub
 
Upvote 0
Top