With the code below, I started the camera app and took a picture, but once I took a picture, the app closed. What should I do when taking multiple shots?
private async void OnImageClicked() { try { await Plugin.Media.CrossMedia.Current.Initialize(); if (!Plugin.Media.CrossMedia.Current.IsCameraAvailable || !Plugin.Media.CrossMedia.Current.IsTakePhotoSupported) { return; } DateTime dt = DateTime.Now; string result = dt.ToString("yyyyMMddHHmmss"); result += ".jpg"; var file = await Plugin.Media.CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions { Name = result }); if (file == null) return; var bytes = new Queue<byte>(); using (var s = file.GetStream()) { var length = s.Length; int b; while ((b = s.ReadByte()) != -1) bytes.Enqueue((byte)b); } File.Copy(file.Path, "/Pic"); PicPoint.Add(result); file.Dispose(); } catch (Exception) { } }