You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I have a ViewModel first approach that creates and destroys its Views on the fly I had a
private void StartCamera()
{
if (!camerasLoaded)
return;
if (cameraView.Cameras.Count > 0)
{
MainThread.BeginInvokeOnMainThread(async () =>
{
cameraView.Camera = cameraView.Cameras.First();
await Task.Delay(500);
await cameraView.StartCameraAsync();
cameraView.BarCodeDetectionEnabled = true;
});
}
}
private void StopCamera()
{
if (cameraView.Camera is not null)
{
MainThread.BeginInvokeOnMainThread(async () =>
{
await cameraView.StopCameraAsync();
});
}
}
so that I can reuse the camera (even on different views).
My current problem is that the camera works for the first time the view is created but after changing the view it is only black.
Is there a way to get this working again?
Activity