Buenas tardes, resulta que tengo una webview an android me funciona perfecto al iniciar la petición pero al momento de cargar otra pagina no muestra el progreso.
este es el código que funciona bien pero sola al iniciar la carga de la pagina principal.
package com.barest.barest;
public class MainActivity extends AppCompatActivity {
WebView webView;
ProgressBar bar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = (WebView) findViewById(R.id.webView);
bar=(ProgressBar) findViewById(R.id.progressBar2);
webView.setWebViewClient(new myWebclient());
webView.setWebChromeClient(new WebChromeClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://miweb/index.html");
}
public class myWebclient extends WebViewClient{
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
bar.setVisibility(View.GONE);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return super.shouldOverrideUrlLoading(view, url);
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if((keyCode==KeyEvent.KEYCODE_BACK) && webView.canGoBack()){
webView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}