Trying to change Android title to look better: requestWindowFeature
<p>Sample code:</p>

<pre><code>// activity contains different controls so inherits from Activity
public class Main extends Activity implements OnClickListener, TextWatcher  {

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        boolean titleSupported = false;            
        if (true) { // for on/off testing
          titleSupported = this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        } 
        setContentView(R.layout.activity_main);

        // see: http://stackoverflow.com/questions/3438276/change-title-bar-text-in-android
        if (titleSupported)) {
          getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
          final TextView myTitleText = (TextView) findViewById(R.id.myTitle);
          if ( myTitleText != null ) {
            myTitleText.setText("@string/app_name");                    
          }                  
        }
</code></pre>

<p>When I include the "requestWindowFeature" the app stops/crashes in emulator. I don't understand why. I am new to Eclipse and Android, but from what I can search, I am doing things in the correct order. Any ideas of the cause?</p>

<p>with <strong>"requestWindowFeature"</strong> <em>before</em> <strong>"setContentView"</strong> I get: </p>

<blockquote>
  <p>02-04 12:35:05.883: E/AndroidRuntime(755): java.lang.RuntimeException:
  Unable to start activity
  ComponentInfo{com.xxx.yyy/com.xxx.yyy.Main}:
  android.util.AndroidRuntimeException: You cannot combine custom titles
  with other title features</p>
</blockquote>

<p>With <strong>"setContentView"</strong> <em>before</em> <strong>"requestWindowFeature"</strong> I get: </p>

<blockquote>
  <p>02-04 12:32:32.660: E/AndroidRuntime(784): java.lang.RuntimeException:
  Unable to start activity ComponentInfo{com.xxx.yyy/com.xxx.yyy.Main}:
  android.util.AndroidRuntimeException: requestFeature() must be called
  before adding content</p>
</blockquote>
