title: Load URL from TextView in WebView Android
body: <p>i'm using this method to get URL from Browsable intent filter and paste that URL in my text field which seems to be working fine but i want to load that URL in my webView. i have tried "<strong>webView.loadUrl(intentUri);</strong>" but it makes the app force close (see log cat below), so i can't load URL's in onCreate <strong>But</strong> i have found a workaround which is to Get URL from my Text Field and Load that URL in my WebView i have tried "<strong>webView.loadUrl(urlEditText.getText());</strong>" in webview settings but i cant get it working the error it give me is "<em>The method loadUrl(String) in the type WebView is not applicable for the arguments (Editable)</em>"</p>
  
  <p><strong>code</strong></p>
  
  <pre><code>TextView uri = (TextView) findViewById(R.id.urlField);
  //if (Intent.ACTION_MAIN.equals(getIntent().getAction())) {
      String intentUri = (new Intent("com.example.browsableintent.MY_ACTION"))
              .toUri(Intent.URI_INTENT_SCHEME).toString();
      uri.setText(intentUri);
      webView.loadUrl(intentUri);
      Log.w("URLHandler", intentUri);
  //} else {
      Uri data = getIntent().getData();
      if (data == null) {
          uri.setText("");
      } else {
          uri.setText(getIntent().getData().toString());
      }
  //}
  </code></pre>
  
  <p><strong>Log Cat</strong></p>
  
  <pre><code>02-11 17:50:48.678: E/AndroidRuntime(29023): FATAL EXCEPTION: main
  02-11 17:50:48.678: E/AndroidRuntime(29023): Process: com.air.swiftmp, PID: 29023
  02-11 17:50:48.678: E/AndroidRuntime(29023): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.air.swiftmp/com.air.swiftmp.MainActivity}: java.lang.NullPointerException
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread.access$800(ActivityThread.java:163)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.os.Handler.dispatchMessage(Handler.java:102)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.os.Looper.loop(Looper.java:157)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread.main(ActivityThread.java:5335)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at   java.lang.reflect.Method.invokeNative(Native Method)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at java.lang.reflect.Method.invoke(Method.java:515)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at dalvik.system.NativeStart.main(Native Method)
  02-11 17:50:48.678: E/AndroidRuntime(29023): Caused by: java.lang.NullPointerException
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at com.air.swiftmp.MainActivity.onCreate(MainActivity.java:95)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.Activity.performCreate(Activity.java:5389)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
  02-11 17:50:48.678: E/AndroidRuntime(29023):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)
  </code></pre>
  
  <p>i just want a way to Get URL from my Text Field and Load it in the WebView either in onCreate or in webView Settings. Thanks</p>