mirror of
https://github.com/apache/cordova-plugin-splashscreen.git
synced 2026-05-03 00:00:03 +08:00
CB-11326 Prevent crash when initializing plugin after navigating to another URL
This commit is contained in:
@@ -83,7 +83,13 @@ public class SplashScreen extends CordovaPlugin {
|
||||
return;
|
||||
}
|
||||
// Make WebView invisible while loading URL
|
||||
getView().setVisibility(View.INVISIBLE);
|
||||
// CB-11326 Ensure we're calling this on UI thread
|
||||
cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getView().setVisibility(View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
int drawableId = preferences.getInteger("SplashDrawableId", 0);
|
||||
if (drawableId == 0) {
|
||||
String splashResource = preferences.getString("SplashScreen", "screen");
|
||||
|
||||
Reference in New Issue
Block a user