Forum Libraries, Components, and Plugins
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

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)

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)

    var filePath = file.Path;

      ... move image


Ps.: It's a great plugin.


  • 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.