title: Issue with using an xml for a second activity (R.id issue)
body: <p>Hey guys so I'm a bit new to Android programming and I have an issue and need help.</p>
  
  <p>So I'll use the first app that the official android site uses for training (http://developer.android.com/training/basics/firstapp/starting-activity.html)</p>
  
  <p>and I'm confused about the creating second activity part. So after they've passed the intent they create a new TextView using java code (instead of XML) so I tried creating that TextView using the xml. I created a new TextView in the xml for the second activity and I give it an id like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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"
      tools:context=".DisplayMessageActivity" &gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello_world" 
          android:id="@+id/new_Text"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and here's the java code for the second activity:</p>
  
  <pre><code>package com.example.myfirstapp;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.view.MenuItem;
  import android.widget.TextView;
  import android.support.v4.app.NavUtils;
  
      public class DisplayMessageActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          // Get the message from the intent
          Intent intent = getIntent();
          String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
  
          // Create the text view
          TextView textView = (TextView) findViewById(R.id.new_Text);
          textView.setTextSize(40);
          textView.setText(message);
  
          // Set the text view as the activity layout
          setContentView(textView);
  
          // Show the Up button in the action bar.
          // getActionBar().setDisplayHomeAsUpEnabled(true);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
          case android.R.id.home:
              NavUtils.navigateUpFromSameTask(this);
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
  }
  </code></pre>
  
  <p>All the code worked fine before I changed it. I changed </p>
  
  <pre><code>TextView textView = new TextView(this);
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>TextView textView = (TextView) findViewById(R.id.new_Text);
  </code></pre>
  
  <p>but for some reason it can't find new_Text and Eclipse only suggests id's from my main.xml. Why is it that way? Is it because R.id.blabla only gets id's from main.xml? So am I forced to make layouts using java code if they're not going to be from main.xml?</p>