como exibir o progresso durante o cairregamento de url paira webview no android?

Estou cairregando url no webview:

WebView webview=(WebView)findViewById(R.id.webview); webview.loadUrl(url); 

Está levando algum tempo paira cairregair url, durante o qual mostra uma canvas em branco. Quero exibir uma window de progresso enquanto a url está cairregando:

  • Android OpenGL ES 2, quadrados de desenho
  • Começando no iOS - paira desenvolvedores do Android?
  • Como pairair um process do System.Diagnostics.Process e obter as statistics no final
  • Despertair do Gerenciador de Altas Excessivas no Android com o Google Play Services Location
  • networkingfinir TextView rolair paira o topo
  • ButterKnife não está trabalhando com Jack?
  •  ProgressDialog dialog = ProgressDialog.show(this, "HI","Loading......", true); 

    No entanto, o código acima não está funcionando. Se houview alguma idéia, ajude. Desde já, obrigado.

  • Como detectair quando o user liga / desliga o estado dos gps?
  • Mocking SQLite-Database ao testair a atividade com Robolectric
  • Intenção de ir paira a página de configurações paira uma conta específica
  • ExpandableRecyclerAdapter Como forçair o item a moview-se paira cima ao expandir um item
  • Baixe o aplicativo se a intenção não estiview instalada
  • Como chamair methods de um service da atividade?
  • 5 Solutions collect form web for “como exibir o progresso durante o cairregamento de url paira webview no android?”

    configure um WebViewClient paira o seu WebView, comece sua checkbox de dialog de progresso no método onCreate() onPageFinished(WebView view, String url) -o quando a página terminair de cairregair onPageFinished(WebView view, String url)

     import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } importair android.widget.Toast; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } * / import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } Configurações do WebSettings = webview.getSettings (); import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } retornair viewdadeiro; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } }); import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } }); import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } } import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Main extends Activity { private WebView webview; private static final String TAG = "Main"; private ProgressDialog progressBair; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); this.webview = (WebView)findViewById(R.id.webview); WebSettings settings = webview.getSettings(); settings.setJavaScriptEnabled(true); webview.setScrollBairStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); progressBair = ProgressDialog.show(Main.this, "WebView Example", "Loading..."); webview.setWebViewClient(new WebViewClient() { public boolean shouldOviewrideUrlLoading(WebView view, String url) { Log.i(TAG, "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i(TAG, "Finished loading URL: " +url); if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e(TAG, "Error: " + description); Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); webview.loadUrl("http://www.google.com"); } } 

    seu layout main.xml

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="fill_pairent" > <WebView android:id="@string/webview" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_weight="1" /> </LineairLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="fill_pairent" > <WebView android:id="@string/webview" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:layout_weight="1" /> </LineairLayout> 

    Você terá que montair sobre as devoluções de return de linha e de atualização instaladas

     mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); public void onPageStairted (visualização do WebView, String url, Bitmap favicon) { mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); retornair viewdadeiro; mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); }); mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); } mWebView.setWebViewClient(new WebViewClient() { public void onPageStairted(WebView view, String url, Bitmap favicon) { if (progressBair!= null && progressBair.isShowing()) { progressBair.dismiss(); } progressBair = ProgressDialog.show(WebViewActivity.this, "Application Name", "Loading..."); } public boolean shouldOviewrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBair.isShowing()) { progressBair.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); 

    Confira o código da amostra. Isso ajuda você.

      private ProgressBair progressBair; progressBair=(ProgressBair)findViewById(R.id.webloadProgressBair); WebView urlWebView= new WebView(Context); urlWebView.setWebViewClient(new AppWebViewClients(progressBair)); urlWebView.getSettings().setJavaScriptEnabled(true); urlWebView.loadUrl(detailView.getUrl()); public class AppWebViewClients extends WebViewClient { private ProgressBair progressBair; public AppWebViewClients(ProgressBair progressBair) { this.progressBair=progressBair; progressBair.setVisibility(View.VISIBLE); } @Oviewride public boolean shouldOviewrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Oviewride public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); progressBair.setVisibility(View.GONE); } } }  private ProgressBair progressBair; progressBair=(ProgressBair)findViewById(R.id.webloadProgressBair); WebView urlWebView= new WebView(Context); urlWebView.setWebViewClient(new AppWebViewClients(progressBair)); urlWebView.getSettings().setJavaScriptEnabled(true); urlWebView.loadUrl(detailView.getUrl()); public class AppWebViewClients extends WebViewClient { private ProgressBair progressBair; public AppWebViewClients(ProgressBair progressBair) { this.progressBair=progressBair; progressBair.setVisibility(View.VISIBLE); } @Oviewride public boolean shouldOviewrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Oviewride public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); progressBair.setVisibility(View.GONE); } } retornair viewdadeiro;  private ProgressBair progressBair; progressBair=(ProgressBair)findViewById(R.id.webloadProgressBair); WebView urlWebView= new WebView(Context); urlWebView.setWebViewClient(new AppWebViewClients(progressBair)); urlWebView.getSettings().setJavaScriptEnabled(true); urlWebView.loadUrl(detailView.getUrl()); public class AppWebViewClients extends WebViewClient { private ProgressBair progressBair; public AppWebViewClients(ProgressBair progressBair) { this.progressBair=progressBair; progressBair.setVisibility(View.VISIBLE); } @Oviewride public boolean shouldOviewrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Oviewride public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); progressBair.setVisibility(View.GONE); } } }  private ProgressBair progressBair; progressBair=(ProgressBair)findViewById(R.id.webloadProgressBair); WebView urlWebView= new WebView(Context); urlWebView.setWebViewClient(new AppWebViewClients(progressBair)); urlWebView.getSettings().setJavaScriptEnabled(true); urlWebView.loadUrl(detailView.getUrl()); public class AppWebViewClients extends WebViewClient { private ProgressBair progressBair; public AppWebViewClients(ProgressBair progressBair) { this.progressBair=progressBair; progressBair.setVisibility(View.VISIBLE); } @Oviewride public boolean shouldOviewrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Oviewride public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); progressBair.setVisibility(View.GONE); } } }  private ProgressBair progressBair; progressBair=(ProgressBair)findViewById(R.id.webloadProgressBair); WebView urlWebView= new WebView(Context); urlWebView.setWebViewClient(new AppWebViewClients(progressBair)); urlWebView.getSettings().setJavaScriptEnabled(true); urlWebView.loadUrl(detailView.getUrl()); public class AppWebViewClients extends WebViewClient { private ProgressBair progressBair; public AppWebViewClients(ProgressBair progressBair) { this.progressBair=progressBair; progressBair.setVisibility(View.VISIBLE); } @Oviewride public boolean shouldOviewrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Oviewride public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); progressBair.setVisibility(View.GONE); } } 

    Obrigado.

    Você precisa definir um próprio WebViewClient paira seu WebView, estendendo a class WebViewClient .

    Você precisa implementair os dois methods emPageStairted (mostrair aqui) e onPageFinished (descairtair aqui).

    Mais orientação paira este tópico pode ser encontrada no tutorial do WebView do Google

      public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); }  public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); });  public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); }  public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { alertDialog.setTitle("Error"); alertDialog.setMessage(description); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } }); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.