Android webview pageStarted not detected, facebook unable to cancel share <p>I am sharing a link using my webview.</p> <p>"<a href="http://m.facebook.com/sharer.php?u=" rel="nofollow noreferrer">http://m.facebook.com/sharer.php?u=</a>" + urltoshare;</p> <p>My code is:</p> <pre><code>WebView myWebView = (WebView) findViewById(R.id.wvForFB); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); myWebView.setWebViewClient(new WebViewClient(){ @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (!loadingFinished) { redirect = true; } loadingFinished = false; view.loadUrl(url); return true; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if(!redirect){ loadingFinished = true; } if(loadingFinished &amp;&amp; !redirect){ //HIDE LOADING IT HAS FINISHED myrelativebar.setVisibility(View.GONE); myprogressbar.setVisibility(View.GONE); } else{ redirect = false; } } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, null); loadingFinished = false; myrelativebar.setVisibility(View.VISIBLE); myprogressbar.setVisibility(View.VISIBLE); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(getApplicationContext(), "" + description, Toast.LENGTH_SHORT).show(); } }); myWebView.loadUrl(attrurl); </code></pre> <p>I need to detect the cancel event on this view. But event on clicking <strong>cancel or Post</strong> <strong>DOES NOT call onpageStarted</strong>, not internally or via debugging for pagestarted.I want to detect cancel event and hide the webview. Do suggest any workaround.</p> <p><img src="https://i.stack.imgur.com/RRCCj.png" alt="Share page opened using this link"></p>