Please help me this question. I am working with webview. And I faced two problem :
If you know why or have any suggest please help me. Note : I am working with : Jquery Mobile in server side(Web side).
Those are my Webview client and Webview init source code.
private class MyWebViewClient extends WebViewClient{
private static final String TAG = "MyWebViewClient";
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
Log.v(TAG, "onPageFinished url: " + url);
}
@Override
public void onLoadResource(WebView view, String url){
Log.v(TAG, "onLoadResource url: " + url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
Log.v(TAG, "onPageStarted url: " + url);
}
@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
Log.v(TAG, "onReceivedError url: " + failingUrl);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.v(TAG, "shouldOverrideUrlLoading : " + url);
return false;
}
}
This is my webview init :
mWebView = new WebView(getActivity());
mWebView.setWebViewClient(new MyWebViewClient());
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
String link = getArguments().getString(PARAMETER_LINK);
boolean deleteWVData = getArguments().getBoolean(PARAMETER_DELETE_DATA);
if(deleteWVData)
mWebView.clearCache(true);
I believe onPageStarted
is only called when a new page is loaded.
E.g.g you are on index.html and navigate to contact.html
Most mobile frameworks (like, jquery mobile, ionic, angualar) will stay on the index.html page and only modify the content. Hence, onPageStarted is not called, but onPageFinished is
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With