title: How do I move to a new activity in android?
body: <p>I've seen some solutions that people have posted, but I can't find the flaw in my code. It crashes on opening.</p>
  
  <p>Here's my Main activity. </p>
  
  <pre><code>public class MainActivity extends Activity 
  {
      Button guy, girl;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          guy = (Button) findViewById(R.id.bGuy);
          girl = (Button) findViewById(R.id.bGirl);
  
          guy.setOnClickListener(new View.OnClickListener() {
              public void onClick(View aView)
              {
                  Intent toAnotherActivity = new Intent(aView.getContext(), ScreenGuy.class);
                  startActivityForResult(toAnotherActivity, 0);
              }
          });
      }   
  }   
  </code></pre>
  
  <p>And the .xml for it</p>
  
  <pre class="lang-xml prettyprint-override"><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"
  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=".MainActivity" &gt;
  
  &lt;TextView
      android:id="@+id/get_over"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="50dp"
      android:text="@string/get_over"
      android:textSize="20sp" /&gt;
  
  &lt;Button
      android:id="@+id/bGuy"
      android:layout_width="120dp"
      android:layout_height="40dp"
      android:layout_alignLeft="@+id/get_over"
      android:layout_below="@+id/get_over"
      android:layout_marginTop="66dp"
      android:text="@string/guy" 
      android:onClick="sendMessage"
       /&gt;
  
  &lt;Button
      android:id="@+id/bGirl"
      android:layout_width="120dp"
      android:layout_height="40dp"
      android:layout_alignBaseline="@+id/bGuy"
      android:layout_alignBottom="@+id/bGuy"
      android:layout_alignRight="@+id/get_over"
      android:text="@string/girl"
       /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have another screen I want to move to on the button press of "Guy".</p>