title: Layout Changes after Activity is Completed
body: <p>I am creating an android app and I want to make it so that if I click a button, it will switch to a different layout in a different activity. I will have to add a lot more code in to the activity, so just changing layouts within the first view is not an option. I want my <code>Main</code> activity to be linked with my <code>main.xml</code> and <code>searchResults</code> activity to be with <code>search_results.xml</code> Here is my source code in my Main activity:</p>
  
  <pre><code>public void OnResult(View v)
  {
      Intent myIntent = new Intent(ParseStarterProjectActivity.this, searchResults.class);
      ParseStarterProjectActivity.this.startActivity(myIntent);
  }
  </code></pre>
  
  <p><code>OnResult</code> is called by the onClick event within my xml file. My <code>searchResults</code> activity looks like this:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.school_results);
      Toast.makeText(getApplicationContext(), "In searchResults Activity!", Toast.LENGTH_LONG).show();
      finish();
  </code></pre>
  
  <p>When I was debugging I found out that it is calling <code>searchResults</code>, but it is not displaying the layout. It is going away from my main layout, but it isn't displaying my search_results layout. It is displaying the toast properly too. 
  The only error I got in the logcat was:</p>
  
  <pre><code>Parent View is not a TextView
  </code></pre>
  
  <p>Any help would be appreciated as this problem is putting my project at a standstill.</p>
  
  <p><b>Edit:</b> Here is my searchResults.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;TableRow
          android:id="@+id/tableRow1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;EditText
              android:id="@+id/editText1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:ems="10"
              android:inputType="textPersonName" &gt;
  
              &lt;requestFocus /&gt;
          &lt;/EditText&gt;
  
          &lt;Button
              android:id="@+id/button1"
              style="?android:attr/buttonStyleSmall"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Button" /&gt;
  
      &lt;/TableRow&gt;
  
      &lt;TableRow
           android:id="@+id/tableRow2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;EditText
              android:id="@+id/EditText01"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:ems="10"
              android:inputType="textPersonName" /&gt;
  
      &lt;Button
          android:id="@+id/Button01"
          style="?android:attr/buttonStyleSmall"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button" /&gt;
      &lt;/TableRow&gt;
  
  &lt;TableRow
           android:id="@+id/tableRow2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;EditText
              android:id="@+id/EditText01"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:ems="10"
              android:inputType="textPersonName" /&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>