title: Android - startActivity(intent) crashes application
body: <p>I'm trying to make it so that when a button is pressed this method launches a new activity, but the app crashes before the second activity is ever started. The button corresponds to the method correctly and the new activity is listed in the manifest file. </p>
  
  <p>MainActivity method:</p>
  
  <pre><code>public void okay(View view) {
  
          Intent intent = new Intent(MainActivity.this, DisplayActivity.class);
  
          boolean dayofweek, season, daystill;
          dayofweek = ((CheckBox) findViewById(R.id.checkBoxDayofweek)).isChecked();
          season = ((CheckBox) findViewById(R.id.checkBoxSeason)).isChecked();
          daystill = ((CheckBox) findViewById(R.id.checkBoxDaystill)).isChecked();
  
          intent.putExtra(EXTRA_DAYOFWEEK, dayofweek);
          intent.putExtra(EXTRA_SEASON, season);
          intent.putExtra(EXTRA_DAYSTILL, daystill);
  
          DatePicker datepicker = (DatePicker) findViewById(R.id.datePicker);
          int day, month, year;
          day = datepicker.getDayOfMonth();
          month = datepicker.getMonth();
          year = datepicker.getYear();
  
          intent.putExtra(EXTRA_DAY, day);
          intent.putExtra(EXTRA_MONTH, month);
          intent.putExtra(EXTRA_YEAR, year);
  
          startActivity(intent);
  
      }
  </code></pre>
  
  <p>DisplayActivity:</p>
  
  <pre><code>public class DisplayActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          Intent intent = getIntent();
          boolean dayofweek = intent.getBooleanExtra(MainActivity.EXTRA_DAYOFWEEK, false);
          boolean season = intent.getBooleanExtra(MainActivity.EXTRA_SEASON, false);
          boolean daystill = intent.getBooleanExtra(MainActivity.EXTRA_DAYSTILL, false);
          int day = intent.getIntExtra(MainActivity.EXTRA_DAY, 0);
          int month = intent.getIntExtra(MainActivity.EXTRA_MONTH, 0);
          int year = intent.getIntExtra(MainActivity.EXTRA_YEAR, 0);
  
          TextView output = new TextView(this);
          output.setTextSize(30);
  
          String s = day + "/" + month + "/" + year + "\n";
          if(dayofweek) s += "";
  
          output.setText(s);
          setContentView(output);
  
      }
  }
  </code></pre>