Change Text on Landscape mode with Java Code and not XML (Android)
<p>I wrote my layout entirely in java code because  it was just more convenient. (I had a lot of <code>textViews</code> and using <code>for</code> statements were more convenient).</p>

<p>However, my TextViews require the day of the week and in portrait mode, I would like to cut the day of the week to a short form. For example, I want "Sunday" to show "Sun" for portrait mode, but "Sunday" for landscape mode.</p>

<p>I understand how to do this in XML files, but how do I do it in code?</p>

<p>I.e. sample code:</p>

<pre><code>LinearLayout parent = new LinearLayout(getApplicationContext());
parent.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
TextView example = new TextView;
example.setLayoutParams(mparams);
example.setText("Sunday"); //&lt;--make this "Sun" when in portrait but "Sunday" in landscape
parent.addView(example);
</code></pre>
