title: Opening a new layout from a different layout?
body: <p>I followed this tutorial (It's old, but I couldn't find any others; <a href="http://learnandroid.blogspot.com/2008/01/opening-new-screen-in-android.html" rel="nofollow">http://learnandroid.blogspot.com/2008/01/opening-new-screen-in-android.html</a>)</p>
  
  <p>So, I have it so that when I click on some text, it should open a different layout. </p>
  
  <p>This is the XML code for the text I click on to open it:</p>
  
  <pre><code>&lt;TextView android:textAppearance="?android:attr/textAppearanceSmall" 
  android:layout_height="wrap_content" 
  android:text="Not a member? Sign up now!" 
  android:layout_width="wrap_content" 
  android:id="@+id/signupText" 
  android:layout_gravity="center"&gt;&lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And this is the Java coding for the Layout with the clickable text on it (The first "screen"):</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.TextView;
  
  public class NetworkActivity extends Activity {
  public void onCreate(Bundle icicle)
     {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        TextView click = (TextView) findViewById(R.id.signupText);
        click.setOnClickListener(new View.OnClickListener() {
            public void onClick(View arg0) {
            Intent i = new Intent(NetworkActivity.this, Signup.class);
            startActivity(i);
            } 
         });
      }
   }
  </code></pre>
  
  <p>The Java code for the second layout:</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.TextView;
  
  public class Signup extends Activity
  {
  public void onCreate(Bundle icicle)
  {
    super.onCreate(icicle);
    setContentView(R.layout.signup);
    TextView b = (TextView) findViewById(R.id.signupText);
    b.setOnClickListener(new View.OnClickListener() {
       public void onClick(View arg0) {
       setResult(RESULT_OK);
       finish();
       } 
    });
   }
  }
  </code></pre>
  
  <p>There's nothing special in the XML code for the second layout. (Should there be?)</p>
  
  <p>When I click on the text in the Emulator, I get the error message that it's closed unexpectedly. How do I fix this?</p>
  
  <p>Oh, and I saw other questions kind of like mine, but they weren't any help. I'm new to all this, so please don't get angry if I've done something "wrong". Thanks for the help in advance. =]</p>