Note that there are some explanatory texts on larger screens.

plurals
  1. POWebView Progress Dialog won't dismiss
    primarykey
    data
    text
    <p>When a page loads up I show the <strong>Progress Dialog</strong>, and I dismiss it when the page finishes loading. After that if there a picture that loads when I scroll down, the <strong>Progress Dialog</strong> will show up, but doesn't disappears after the picture is loaded. How can I fix this problem? </p> <p>This is my code, use it and you will know exactly what I mean. I will appreciate it if you can help. </p> <pre><code>import android.app.Activity; import android.app.ProgressDialog; import android.os.Bundle; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends Activity { // Declaring WebView browser; ProgressDialog pd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initializing browser = (WebView) findViewById(R.id.webView1); browser.getSettings().setJavaScriptEnabled(true); browser.getSettings().setLoadWithOverviewMode(true); browser.getSettings().setUseWideViewPort(true); browser.getSettings().setBuiltInZoomControls(true); // Loading browser.loadUrl("http://www.tumblr.com/tagged/cool%20pictures"); // Progress Dialog pd = ProgressDialog.show(MainActivity.this, "", "Loading. Please wait...", true); browser.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { try { view.loadUrl(url); } catch (Exception e) { e.printStackTrace(); } return true; } public void onLoadResource(WebView view, String url) { try { if (pd.isShowing() == false) { pd = ProgressDialog.show(MainActivity.this, "", "Loading. Please wait...", true); } } catch (Exception e) { e.printStackTrace(); } } public void onPageFinished(WebView view, String url) { if (pd.isShowing()) { pd.dismiss(); } } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload