title: Android WebVIew WebViewClient
body: <p>I have a webView in my application. When a person loads a url, the webpage is loaded in the browser and not in my application as the options menu is the default and not what I have assigned. How can I stop this and make it load in my webview and not the browser?</p>
  <p>I tried webViewClient but it doesn't seem to work.</p>
  <pre><code>public class webView extends Activity {
      
      WebView myWebView;
      String url;
        
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
        
          myWebView = (WebView) findViewById(R.id.webview);
          myWebView.getSettings().setJavaScriptEnabled(true);
          url = &quot;http://d.android.com&quot;;
          myWebView.setWebViewClient(new WebViewClient()       
          {
               @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) 
              {
                  
                  //url=&quot;http://google.com&quot;;
                  //view.loadUrl(url);
                  System.out.println(&quot;hello&quot;);
                  return true;
              }
          });
          //Toast.makeText(this, &quot;&quot;, Toast.LENGTH_SHORT);
          myWebView.loadUrl(url);
      }
  /** Creteing an options menu**/
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          
          MenuInflater inflater = getMenuInflater();
            inflater.inflate(R.menu.menu, menu);
            //return true;
          // TODO Auto-generated method stub
          return super.onCreateOptionsMenu(menu);
      }
  </code></pre>