title: How to listen to webview url click and enable/disable buttons on actionbar
body: <p>I'm developing an application in which I'm using <code>webview</code> to load certain websites. I also have customized <code>actionbar</code> on which I have website navigation <code>button</code>. Here is the view how my layout is looking like:</p>
  
  <p><img src="https://i.stack.imgur.com/AL1EP.png" alt="How it looks to me."></p>
  
  <p>When I load website my all three buttons are visible, but I want them to be visible at that time only when user has clicked on some URL, so user easily understand the purpose of those buttons.</p>
  
  <p>I have added all the functionalities to those button. Here is my code:</p>
  
  <pre><code>website_back = (ImageButton) cView.findViewById(R.id.website_back);
  website_forward = (ImageButton) cView.findViewById(R.id.website_forward);
  website_refresh = (ImageButton) cView.findViewById(R.id.website_refresh);
  
  if (v.getId() == R.id.website_back) {
      webview.goBack();
  }
  if (v.getId() == R.id.website_forward) {
      webview.goForward();
  }
  if (v.getId() == R.id.website_refresh) {
      webview.reload();
  }
  </code></pre>
  
  <p>My WebViewClient:</p>
  
  <pre><code>private class HelloWebViewClient extends WebViewClient {
  
      public void onPageStarted(WebView view, String url, Bitmap favicon) {
          progress.setVisibility(View.VISIBLE);
          super.onPageStarted(view, url, favicon);
      }
  
      public void onPageFinished(WebView view, String url) {
          progress.setVisibility(View.GONE);
          super.onPageFinished(view, url);
      }
  
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          website_back.setImageResource(R.drawable.webview_back);
          view.loadUrl(url);
          return true;
      }
  }
  </code></pre>
  
  <p>How can I only show those buttons when user has clicked on some URL, on the website launched in the webview?</p>
  
  <p>Any kind of help will be appreciated.</p>