CrossMedia.Camera backs to main page after take a photo

I don't know if this issue has been asked here.

I'm using Plugin.CrossMedia in Xamarin Forms, and sometimes, after the camera takes a photo, the application turn back to main page, and all worked is lost in actual page, including the image.

I'm doing this:

if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
{
    return;
}

var photoName= "photo.png";
var sizeImg= Plugin.Media.Abstractions.PhotoSize.Small;
var mediaOptions = new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
    SaveToAlbum = false,
    AllowCropping = true,
    DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Rear,
    Name = photoName,
    PhotoSize = sizeImg
};

using (var file = await CrossMedia.Current.TakePhotoAsync(mediaOptions))
{
    if (file == null)
        return;

    var filePath = file.Path;

      ... move image

}

Ps.: It's a great plugin.

Answers

  • prashantvcprashantvc USXamarin Team Xamurai

    @oliveiravitor3 Could you give more context to the problem? Are you using X.Forms? Is it regular Xamarin.iOS app?
    It will help us if you could share sample project demonstrating the problem

  • oliveiravitor3oliveiravitor3 BRMember ✭✭

    Hi @prashantvc

    Yes, I'm using Xamarin.Forms, and this problem was only found inside android.
    But i think this problem only occurs with lower devices, and since my project is very large, maybe I have failed in performance. I will try to improve.

Sign In or Register to comment.