Android development- Make button open new screen
<p>What I'm trying to do is probably really simple but I've followed several different instructions and cant seem to get it to work. Basically all I want to do is create a button in an xml layout under(main_activity) reference it in java (MainActivity), then set up that button to open its own new xml file. As of now when I click on the button (on my phone not the emulator) is crashes. This is what I have so far. Thanks for looking at it. </p>

<p>xml screen one</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" &gt;

&lt;TextView
    android:id="@+id/tvFirst"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:text="Application"
    android:textSize="30dp" /&gt;

&lt;Button
    android:id="@+id/b1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/tvFirst"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="46dp"
    android:text="1"
    android:textSize="30dp" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>java screen1</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button b = (Button) findViewById(R.id.b1);

    b.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Intent i = new Intent(MainActivity.this, ButtonOne.class);
            startActivity(i);
        }

    });
}
}
</code></pre>

<p>xml screen2</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="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" &gt;

&lt;TextView
    android:id="@+id/tvButtonOne"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="This is te button one screen" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>java screen2</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    findViewById(R.layout.buttonone);
}

}
</code></pre>
