title: WebView loading Url
body: <p>So I'm working on adding some web view stuff and will eventually make this more complicated but for now am just trying to get the basics working. I have my xml built and such and I am inflating it on top of another view. So its in like a dialog box. </p>
  
  <pre><code>web = (WebView)findViewById(R.id.WebView);
  
  name = (TextView) findViewById(R.id.name);
  name.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
  
          final Dialog dialog = new Dialog(Hydrogen.this);
          dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          dialog.setContentView(R.layout.web);
          dialog.setCancelable(true);
  
          web.loadUrl("http://en.wikipedia.org/wiki/" + name.getText().toString());
  
          RelativeLayout btn = (RelativeLayout) dialog.findViewById(R.id.close);
          btn.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  dialog.dismiss();
                          }
              });     
          dialog.show();
  }});
  </code></pre>
  
  <p>Basically thats my code regarding the WebView etc. The problem is on line 145 which is the web.loadUrl line. I'n not sure whats wrong but every time I try to open the Dialog it crashs. Thanks. </p>
  
  <pre><code>02-16 17:16:08.313: ERROR/AndroidRuntime(8122): FATAL EXCEPTION: main
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122): java.lang.NullPointerException
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at table.periodic.Hydrogen$1.onClick(Hydrogen.java:145)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.view.View.performClick(View.java:2408)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.view.View$PerformClick.run(View.java:8816)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Handler.handleCallback(Handler.java:587)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Handler.dispatchMessage(Handler.java:92)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Looper.loop(Looper.java:123)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at java.lang.reflect.Method.invoke(Method.java:521)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I also just tried making a seperate project in which to load the web page. Just a WebView loading the URL. It partly worked. It worked to the point that it opened the URL but it did it inside the browser instead of inside the webview. Could be because I named the WebView browser but will try more.</p>