title: How to set webview client?
body: <p>I seen in android documentation  where you use </p>
  
  <pre><code> private class HelloWebViewClient extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
  </code></pre>
  
  <p>To handle when items are clicked within a webview.</p>
  
  <p>The only problem is with me, is that im setting the url in another method.</p>
  
  <p>The HelloWebViewClient overrides that and doesnt use the url that the user can chose from. It just returns null..How could i over ride this method to use the url set by the user?</p>
  
  <p>The URL is loaded when i use it in a regular method with the <code>WebView browser;</code> and then <code>browser.loadUrl(String url)</code></p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.shopping);
  
      findIT = (Button)findViewById(R.id.findIT);
      edittext = (EditText)findViewById(R.id.item);
      type = (RadioGroup)findViewById(R.id.console);
      site = (RadioGroup)findViewById(R.id.shopping_group);
  
      findIT.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              item = edittext.getText().toString();
                  lookUp();
          }
      });
  
  }
  
  public void lookUp(){
  
      browser = (WebView) findViewById(R.id.shoppingBrowser);
      browser.getSettings().setJavaScriptEnabled(true);
      Log.v(item, item);
      getUserPreference();
      browser.setWebViewClient(new HelloWebViewClient());
      browser.loadUrl(url);
  
  
  }
  
  
  
    private class HelloWebViewClient extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String notuse) {
          Log.v("shopping", url+" loaded");
  
  
  
         return true;
      }
  
  
    }
  public void getUserPreference(){
  
      switch(type.getCheckedRadioButtonId()){
      case R.id.item:
          console = "item";
          break;
      case R.id.PS3:
          console = "item";
          break;
      case R.id.item:
          console = "item"; 
          break;
  
      }Log.v("item", console);
       switch(site.getCheckedRadioButtonId()){
  
           case R.id.store:
               url = "http://www.gamestop.com/browse?nav=16k- "+ item +"  " + console;
               break;
           case R.id.store:
               url = "http://www.google.com/search?q="+item + "   " + console+"&amp;tbm=shop&amp;hl=en&amp;aq=0&amp;oq=where+";
               break;
           case R.id.store:
               url = "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dvideogames&amp;field-keywords="+item + "  "+ console+"&amp;x=0&amp;y=0"; 
               Log.v("shopping", url);
            }
         }
    }
  </code></pre>
  
  <p>If you see what im trying to do the user gets to select what site they want to shop from. and from there i set it to the url.</p>