title: How do I "listen" for something in WebView, Android?
body: <pre><code>private class HelloWebViewClient extends WebViewClient {
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              view.loadUrl(url);
              return true;
          }   }
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          webview = (WebView) findViewById(R.id.webview);
          webview.setWebViewClient(new HelloWebViewClient());
          webview.getSettings().setJavaScriptEnabled(true);
          webview.loadUrl("http://mydomain.com");
      }
  </code></pre>
  
  <p>This is a very simple webview demo ( I followed a tutorial to write it).  When a user loads up my application, this webview pops up and he's able to go on the internet inside it.</p>
  
  <p>How do I "listen" for an event? </p>
  
  <ul>
  <li>When a URL contains "google.com"</li>
  <li>Or, when the HTML contains the word "google"</li>
  </ul>
  
  <p>As the user is using my webview to browse the web, I'd like to listen to those things and then call a function when it happens.</p>