CB-11326 Prevent crash when initializing plugin after navigating to another URL

This commit is contained in:
Vladimir Kotikov 2016-06-08 18:04:03 +03:00
parent 0a8b5be3d1
commit 41ca5809b1

View File

@ -83,7 +83,13 @@ public class SplashScreen extends CordovaPlugin {
return; return;
} }
// Make WebView invisible while loading URL // Make WebView invisible while loading URL
// CB-11326 Ensure we're calling this on UI thread
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
getView().setVisibility(View.INVISIBLE); getView().setVisibility(View.INVISIBLE);
}
});
int drawableId = preferences.getInteger("SplashDrawableId", 0); int drawableId = preferences.getInteger("SplashDrawableId", 0);
if (drawableId == 0) { if (drawableId == 0) {
String splashResource = preferences.getString("SplashScreen", "screen"); String splashResource = preferences.getString("SplashScreen", "screen");