title: Android solving compatibility with SDK_INT hack; is this ok?
body: <p>Running the following (note: target > 3.0)</p>
  
  <pre><code>ActionBar actionBar = getActionBar();
  </code></pre>
  
  <p>on Android with version &lt; 3.0 (SDK 11) results in a <code>NoSuchMethodError</code>. </p>
  
  <p>There are several ways to get around this, including reflection and class lazy loading. However, the following seems to work across all the devices I've tested (2.3.6, 3.0, 3.1, 4.0):</p>
  
  <pre><code>boolean hasActionBar = android.os.Build.VERSION.SDK_INT &gt;= 11;
  
  if (hasActionBar) {
      ActionBar actionBar = getActionBar();
  } else {
      // create custom actionbar
  }
  </code></pre>
  
  <p>Note the <code>SDK_INT</code> parameter is <code>static final</code>, which appears to be why this works.</p>
  
  <p>Is this a valid way to deal with compatibility?</p>