title: How to open string(url) in WebView
body: <p>I would like to open a string from EditField, and by pressing button, the page should open in my WebView. Instead of my url is opening by default web browser</p>
  
  <p><strong>XML:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/mey2b.png" alt="enter image description here"></p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>public class WebAdress extends Activity {
  
  WebView webView;
  ImageButton buttonGo;
  EditText textWWW;
  String URL = new String();
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.www);
  
      buttonGo = (ImageButton) findViewById(R.id.imageButton1);
      textWWW  = (EditText) findViewById(R.id.editText1);
      webView = (WebView) findViewById(R.id.webView1);
  
      buttonGo.setOnClickListener(new OnClickListener() {
  
          @SuppressLint("SetJavaScriptEnabled")
          public void onClick(View v) {
              URL = "http://" + textWWW.getText().toString();
              WebSettings settings = webView.getSettings();
              settings.setJavaScriptEnabled(true);
              webView.loadUrl(URL);
              URL = null;
          }
      });
  
  }
  </code></pre>
  
  <p>}</p>