title: Hide title bar if it's not an ActionBar - predict ActionBar presence before setContentView?
body: <p>If my fullscreen preference (off by default) is on, I want my Activity to hide the title bar as well as the notification bar. I can do that with <code>requestWindowFeature(Window.FEATURE_NO_TITLE);</code> + <code>FLAG_FULLSCREEN</code> etc. or perhaps <code>setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);</code></p>
  
  <p>Either of these must happen <strong>before</strong> <code>setContentView()</code> or they will crash. The hard part is:</p>
  
  <ul>
  <li>I target API levels 3 to 14, and I only want to hide the title bar if the Activity is not going to use an ActionBar. Otherwise, <code>FEATURE_NO_TITLE</code> will hide the ActionBar and lose some important controls. (I'll instead settle for "lights-out" mode.)</li>
  <li>I can't see how to find out whether an ActionBar will be used until <strong>after</strong> <code>setContentView()</code>, when it's too late.</li>
  </ul>
  
  <p>Things that don't work:</p>
  
  <ul>
  <li><code>getActionBar()</code> returns null at this early stage.</li>
  <li><code>getWindow.hasFeature(Window.FEATURE_ACTION_BAR)</code> is false.</li>
  <li>Knowing (by reflection) that ActionBar exists as a class is insufficient, because, sticking with the default device theme, that might not always use ActionBar on some Ice Cream Sandwich devices, even though the platform has it. (?)
  <ul>
  <li>Alternatively: can I rely on ICS always having an ActionBar? Why?</li>
  <li>Edit: ok, maybe ICS' title bar is still an ActionBar, just with no items and not even the overflow button? (In which case I still want to hide it.) Can anyone shed any light there?</li>
  </ul></li>
  </ul>
  
  <p>Any ideas? :-)</p>