Skip to content

Commit

Permalink
fix(android): avoid crash on SplashScreen.show() (#2213)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Nov 26, 2019
1 parent 2972661 commit d200727
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion android/capacitor/src/main/java/com/getcapacitor/Splash.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d200727

Please sign in to comment.