title: Android webview browser edit text automatically change with webview change
body: <p>I make a webview in android . there is a webview and edit text and a go button . I want that when the webview change the edit text automatically  change with the current url . example: when i type an url "www.google.com" i go to google if i go to youtube from google  but my edit text stands as "www.google.com". but i want my edit text automaticlly change as the current webview
  This is my java code</p>
  
  <pre><code>package com.example.ashraful.userinterface;
  
  import android.app.Activity;
  import android.graphics.Bitmap;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.KeyEvent;
  import android.view.View;
  import android.view.Window;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.ProgressBar;
  
  public class Main2Activity extends Activity {
  
  WebView web1;
  EditText ed1;
  Button bt1;
  String Address;
  String add;
  ProgressBar pbar;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.activity_main2); web1 =(WebView)findViewById(R.id.webView1);
      ed1 = (EditText)findViewById(R.id.editText1);
      bt1 = (Button)findViewById(R.id.button1);
      pbar = (ProgressBar)findViewById(R.id.progressBar1);
      pbar.setVisibility(View.GONE);
  
      bt1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              Address = "http://" + ed1.getText().toString();
              WebSettings webSetting = web1.getSettings();
              webSetting.setBuiltInZoomControls(true);
              webSetting.setJavaScriptEnabled(true);
              webSetting.setLoadsImagesAutomatically(true);
  
  
              web1.setWebViewClient(new WebViewClient());
  
              web1.loadUrl(Address);
  
          }
      });
  }
  
  public class WebViewClient extends android.webkit.WebViewClient
  {
      @Override
      public void onPageStarted(WebView view, String url, Bitmap favicon) {
  
          // TODO Auto-generated method stub
          super.onPageStarted(view, url, favicon);
          pbar.setVisibility(View.VISIBLE);
      }
  
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
  
          // TODO Auto-generated method stub
          view.loadUrl(url);
          return true;
      }
      @Override
      public void onPageFinished(WebView view, String url) {
  
          // TODO Auto-generated method stub
  
          super.onPageFinished(view, url);
          pbar.setVisibility(View.GONE);
      }
  
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event)
  {
      if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; web1.canGoBack()) {
          web1.goBack();
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  }
  </code></pre>
  
  <p>The this is the xml code </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/activity_main2"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="com.example.ashraful.userinterface.Main2Activity"&gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:text="GO" /&gt;
  
  &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/button1"
      android:layout_alignParentLeft="true"
      android:ems="10"
      android:hint="Type Your URL Here"
      android:layout_toLeftOf="@+id/button1"
      android:layout_toStartOf="@+id/button1" /&gt;
  
  &lt;View
      android:id="@+id/view12"
      android:layout_width="wrap_content"
      android:layout_height="3dp"
      android:layout_alignBottom="@+id/button1"
      android:layout_alignParentLeft="true"
      android:background="#3bbdfa" /&gt;
  
  &lt;WebView
      android:id="@+id/webView1"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@+id/editText1"
      android:layout_centerHorizontal="true" /&gt;
  
  &lt;ProgressBar
      android:id="@+id/progressBar1"
      style="?android:attr/progressBarStyleLarge"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>