Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Android: app freeze + fix #106

Open
softlion opened this issue Mar 3, 2021 · 0 comments
Open

Android: app freeze + fix #106

softlion opened this issue Mar 3, 2021 · 0 comments

Comments

@softlion
Copy link

softlion commented Mar 3, 2021

Please replace this incorrect code which triggers app freeze when real async image sources are used (like SvgImageSource from https://github.com/softlion/XamSvg-Samples).

Replace in https://github.com/NAXAM/mapbox-xamarin-forms/blob/master/Naxam.Mapbox.Platform.Droid/Extensions/ImageSourceExtensions.cs

            return handler?
                .LoadImageAsync(source, context).Result;

With this correct code:

            return handler?
                .LoadImageAsync(source, context).GetAwaiter().GetResult();

Or better: make this method async.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant