title: creating a simple layout on android
body: <p>I'm very new with android development. I'm trying to develop an application, I decided to try out the code below but I keep getting errors when I try to open it on the emulator. please can anyone tell me what I'm doing wrong?</p>
  
  <pre><code>package hajara.android.MyRecipes;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class MyRecipesActivity extends Activity {
    Button btn;
    TextView t1, t2;
    EditText e;
    @Override
    public void onCreate(Bundle icicle) {
       super.onCreate(icicle);
       setContentView(R.layout.main);
  
       t1 = (TextView)findViewById(R.id.text1);
       t2 = (TextView)findViewById(R.id.text2);
        e = (EditText)findViewById(R.id.edit1);
       btn=(Button)findViewById(R.id.button1);
  
     btn.setOnClickListener((OnClickListener) this);
   }
  
  }
  </code></pre>
  
  <p>My main.xml file is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" &gt;
  &lt;TextView
      android:id="@+id/text1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Enter a string:"
  /&gt;
  
  &lt;EditText android:id="@+id/edit1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:cursorVisible="true"
      android:editable="true"
      android:singleLine="true"
  /&gt;
  &lt;Button android:id="@+id/button1"
      android:text="OK"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
  /&gt;
  
  &lt;TextView
      android:id="@+id/text2"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text=""
  /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>