Skip to content

Android Webview cannot render the pdf sometimes and shows blank/white page instead #2983

@gopalawasthi123

Description

@gopalawasthi123

Steps to Reproduce

  1. Open the pdf in the webview using google docs link.
  2. Open the same pdf or different pdf again and again.
  3. Sometimes it will show the blank/white page in the android untill we refresh the webpage again for 1 or 2 times.

Code

public void SetWebView(WebView webview,string externalUrl){
			webview.Tag = "webview";
			webview.Settings.JavaScriptEnabled = true;
			webview.Settings.SupportZoom ();
			webview.Settings.SetAppCacheEnabled(true);
			webview.Settings.DomStorageEnabled = true;
			webview.ZoomOut ();
			webview.ZoomIn ();
			webview.Settings.BuiltInZoomControls = true;
			webview.Settings.LoadWithOverviewMode = true;
			webview.Settings.UseWideViewPort = true;
			//webview.Settings.SetSupportZoom (true);
			webview.Settings.SetPluginState (WebSettings.PluginState.On);
			webview.Settings.GetPluginState ();
            if (externalUrl.StartsWith("http://") || externalUrl.StartsWith("https://"))
                webview.LoadUrl (externalUrl);
			webview.SetWebViewClient (new MonkeyWebViewClient (imgViewBack, imgViewForward, imgRefresh));
			webview.SetWebChromeClient (new WebChromeClient ());
		`}`

Screenshot_20190416-132946 1

Metadata

Metadata

Labels

need-infoIssues that need more information from the author.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions