diff --git a/MediaManager/Plugin.MediaManager.Android/MediaPlayerService.cs b/MediaManager/Plugin.MediaManager.Android/MediaPlayerService.cs index f7f82b22..74ae511c 100644 --- a/MediaManager/Plugin.MediaManager.Android/MediaPlayerService.cs +++ b/MediaManager/Plugin.MediaManager.Android/MediaPlayerService.cs @@ -446,7 +446,16 @@ public async Task Play() Cover = await BitmapFactory.DecodeResourceAsync(Resources, Resource.Drawable.ButtonStar); } else - Cover = await BitmapFactory.DecodeByteArrayAsync(imageByteArray, 0, imageByteArray.Length); + { + try + { + Cover = await BitmapFactory.DecodeByteArrayAsync(imageByteArray, 0, imageByteArray.Length); + } + catch (Java.Lang.OutOfMemoryError) + { + Cover = null; + } + } StartedPlayback = true; } catch (Exception ex) @@ -934,7 +943,13 @@ private void ReleaseWifiLock() if (wifiLock == null || !wifiLock.IsHeld) return; - wifiLock.Release(); + try + { + wifiLock.Release(); + } + catch (Java.Lang.RuntimeException) + { } + wifiLock = null; }