Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Strange out of memory issue in media picker

$
0
0

I'm using following code to allow user to select image from device.

var device = Resolver.Resolve<IDevice> ();
var mediaPicker = DependencyService.Get<IMediaPicker> ();

if (mediaPicker == null) { 
    mediaPicker = device.MediaPicker;
}

MediaFile result = await mediaPicker.SelectPhotoAsync (
    new CameraMediaStorageOptions { 
    DefaultCamera = CameraDevice.Rear
    }
);

But in an android device if i'm trying to upload image more than 3mb then the app crashes and it's a error related to out of memory in android due to larger size of image.

Can any one please suggest how can I solve this issue?


Viewing all articles
Browse latest Browse all 77050

Trending Articles