[postlink]
https://the-best-way-of-life-is-islam.blogspot.com/2015/07/xamarin-mediapickertakephotoasync.html
[/postlink]
I have an Xamarin.Forms app that uses XLabs, it was working fine, but suddenly it started to crash my app, if I take photo or press back button from photo screen, I was googling around for 4 hours and still have no idea why it happening, any ideas or thoughts, please help!
here is my lines of code:
private async Task TakePicture()
{
mediaPicker = Resolver.Resolve<IDevice>().MediaPicker;
try
{
var mediaFile = await mediaPicker.TakePhotoAsync(new CameraMediaStorageOptions
{
DefaultCamera = CameraDevice.Front,
MaxPixelDimension = 1,
PercentQuality = 2,
});
var image = GetResizedImage(mediaFile.Source, 990, 560);
OnImageUpdate(this, image);
}
catch (Exception ex)
{
this.status = ex.Message;
}
}
my permission are alright:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
Enregistrer un commentaire