title: Launching a new activity just by touching the screen
body: <p>I am trying to launch a brand new activity that will display a new string when I touch the screen. Here is the MainActivity code. My first activity displays a &quot;hello world&quot;, and my new activity should simply displays a new string. All the resource files and the manifest are correct. However, the run keeps crashing after the onClick.</p>
  <pre><code>package com.example.myfirsttest;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  
  
  public class MainActivity extends Activity{
  
      @Override
      protected void onCreate(Bundle icicle) {
          super.onCreate(icicle);
          setContentView(R.layout.activity_main);
      
      
      //Call the NewActivity from the MainActivity
          View view = getWindow().getDecorView().findViewById(android.R.id.content);
          view.setOnClickListener(new OnClickListener() {
              
              @Override
              public void onClick(View v) {
                  Intent startIntent = new Intent(MainActivity.this,NewActivity.class);
                  startActivity(startIntent);
                  
              }
          }); 
      }
  }
  </code></pre>