title: Android: On changing the image on ImageView the Edittext disappeared
body: <p>I am new to android app development on eclipse IDE.</p>
  
  <p>I am trying to make a basic app in which, on clicking the button both the image in ImageView as well as the text in EditText replaces with another image and text respectively. </p>
  
  <p>But on doing so, primarily when the app starts, a button is displayed on the top, then the ImageView and then the EditText, they work fine, but on clicking the button, only image is replaced successfully while my EditText disappeared. Can you help me out why this happened and how to rectify it?</p>
  
  <p>xml file:
      </p>
  
  <pre><code>&lt;Button
      android:id="@+id/button1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="@string/click_it" /&gt;
  
  
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/button1"
      android:layout_below="@+id/button1"
      android:src="@drawable/prac" /&gt;
  
  &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignRight="@+id/imageView1"
      android:layout_below="@+id/imageView1"
      android:layout_marginTop="30dp"
      android:ems="10"
      android:text="hello!" &gt;
  
      &lt;requestFocus /&gt;
  &lt;/EditText&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>java file:</p>
  
  <pre><code>package com.example.practicetwo;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.*;
  import android.widget.*;
  
  public class MainActivity extends Activity {
  Button b1;
  ImageView iv1;
  EditText et1;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      b1 = (Button)findViewById(new R.id().button1);
      iv1 = (ImageView)findViewById(new R.id().imageView1);
      et1 = (EditText)findViewById(new R.id().editText1);
      b1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
              iv1.setImageResource(R.drawable.prac1);
              et1.setText("how r u?");
          }
      });
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>