From b1f0c037bd1e88ee91e4cdb6e876dc2c380d1248 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Mon, 24 Jan 2011 12:43:28 -0800 Subject: [PATCH] Getting rid of black screen between native loading screen and actual PhoneGap app. --- framework/src/com/phonegap/DroidGap.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index ceddf979..4e63a8a5 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -15,6 +15,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Color; +import android.graphics.Picture; import android.net.Uri; import android.os.Bundle; import android.util.Log; @@ -27,6 +28,7 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebStorage; import android.webkit.WebView; +import android.webkit.WebView.PictureListener; import android.webkit.WebViewClient; import android.webkit.GeolocationPermissions.Callback; import android.webkit.WebSettings.LayoutAlgorithm; @@ -953,7 +955,11 @@ public class DroidGap extends PhonegapActivity { // If splash screen is showing, clear it if (this.ctx.splashscreen != 0) { this.ctx.splashscreen = 0; - appView.setBackgroundResource(0); + view.setPictureListener(new PictureListener(){ + public void onNewPicture(WebView viewtwo, Picture picture) { + appView.setBackgroundResource(0); + } + }); } // Stop "app loading" spinner if showing