title: Edittext disappears when i change screen orientation?
body: <p>Thanks in advance.</p>
  
  <p>This is my sample code. Whenever i try to run it and change the screen orientation both the edit text disappears and i have to restart the application.
  please help me out </p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      ed1=(EditText)findViewById(R.id.ed1);
      ed2=(EditText)findViewById(R.id.ed2);
  
      ed1.addTextChangedListener(new TextWatcher()                          
      {
          public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
          }
  
          public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                  int arg3) {
          }
  
          public void afterTextChanged(Editable arg0) {    
              ed2.setVisibility(View.INVISIBLE);
          }
      }); 
  
      ed2.addTextChangedListener(new TextWatcher()            
      {
          public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
  
          }    
  
          public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                  int arg3) {
          }
  
          public void afterTextChanged(Editable arg0) {   
              ed1.setVisibility(View.INVISIBLE);
          }
      });
  }
  </code></pre>
  
  <p>This is my main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  
  &lt;TableLayout
      android:id="@+id/table"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:padding="25dip"
      android:stretchColumns="0,1" &gt;
  
      &lt;TableRow&gt;
  
          &lt;TextView
              android:id="@+id/text1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="20dip"
              android:text="Edit Text 1"
              android:textSize="15dip" /&gt;
  
          &lt;EditText
              android:id="@+id/ed1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="5dip"
              android:layout_marginTop="20dip"
              android:maxLength="10"
              android:numeric="integer|decimal" /&gt;
      &lt;/TableRow&gt;
  
      &lt;TableRow&gt;
  
          &lt;TextView
              android:id="@+id/or_text"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="5dip"
              android:text="OR"
              android:textSize="20dip" /&gt;
      &lt;/TableRow&gt;
  
      &lt;TableRow&gt;
  
          &lt;TextView
              android:id="@+id/text2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="20dip"
              android:text="Edit Text2"
              android:textSize="15dip" /&gt;
  
          &lt;EditText
              android:id="@+id/ed2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="5dip"
              android:layout_marginTop="20dip"
              android:maxLength="10"
              android:numeric="integer|decimal" /&gt;
      &lt;/TableRow&gt;
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p></p>