Why can't I alter a button's properties before setContentView is called?
<p>Sorry in advance in case this is a stupid question! </p>

<p>I was playing around with a couple of things in Android, and I was experimenting with changing elements at run time which were specified in the xml file. </p>

<pre><code>Button buttonSetup = (Button) findViewById(R.id.buttonSetup);
buttonSetup.setTextSize(40);
</code></pre>

<p>However, I noticed that this crashed the application if you make the changes before -</p>

<pre><code>setContentView(R.layout.main);
</code></pre>

<p>What is the reason for this? (Sorry if I'm missing something obvious! I think my brain has gone into hibernation for Winter!) </p>

<p>I had thought it would be best practice to alter elements <em>before</em> setContentView, so that if you alter a lot of elements (say half a dozen or so attributes over half a dozen elements) it is not obvious to the user with things changing on screen.</p>

<p>Thanks! </p>
