Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could start a ProgressDialog before you load the website and dismiss it after the loading is done.</p> <p>Code should look something like this:</p> <pre><code>ProgressDialog progressDialog = ProgressDialog.show(this, "", "Loading..."); wv.loadUrl("http://www.yourwebsite.com"); progressDialog.dismiss(); </code></pre> <p>EDIT: new code for every new url clicked</p> <p>You should add this to your WebViewClient and also make you (ProgressDialog) pd a member variable.</p> <pre><code>@Override public boolean shouldOverrideUrlLoading(WebView view, String url) { pd = ProgressDialog.show(this, "Page is:", "Loading...",true); view.loadUrl(url); return true; } </code></pre> <p>EDIT:</p> <p>You should make the ProgressDialog pd a member variable.</p> <pre><code>public class Main extends Activity { private ProgressDialog pd; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); pd = ProgressDialog.show(this, "Page is", "Loading...",true); WebView wv = (WebView)findViewById(R.id.my_webview); wv.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { if(pd.isShowing()&amp;&amp;pd!=null); { pd.dismiss(); } } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { pd = ProgressDialog.show(Main.this, "Page is", "Loading...", true); } }); wv.loadUrl("http://www.websitehere.com"); } } </code></pre> <p>EDIT: using onPageStarted.</p>
    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.
    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