Reputation: 693
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);
Upvotes: 10
Views: 8867
Reputation: 1
index.html#xxxxxxx
index.html#aaaaaa
are considered the same by the WebView
,in this case,onPageStarted
wont'be called
Upvotes: 0
Reputation: 11
Update the webview and check.
I faced this issue when the current version of webview is 60.0.3112.107 while the version in the phone was 57.x.xxxx.xxx
Upvotes: 0
Reputation: 12900
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
Upvotes: 3