From d200727048c2147feae3922e65c14843f8c14c30 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Tue, 26 Nov 2019 15:38:10 +0100 Subject: [PATCH] fix(android): avoid crash on SplashScreen.show() (#2213) --- .../capacitor/src/main/java/com/getcapacitor/Splash.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Splash.java b/android/capacitor/src/main/java/com/getcapacitor/Splash.java index 57acfd2b5..1f8593abc 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Splash.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Splash.java @@ -233,7 +233,11 @@ public void run() { // Required to enable the view to actually fade params.format = PixelFormat.TRANSLUCENT; - wm.addView(splashImage, params); + try { + wm.addView(splashImage, params); + } catch (IllegalStateException ex) { + Log.d(LogUtils.getCoreTag(), "Could not add splash view"); + } splashImage.setAlpha(0f);