How do you version code in Android without compiler warnings?
<p>Google's docs say to use this kind of code to ensure new code is not executed on old platforms:</p>

<pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) {
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
}
</code></pre>

<p>But when I do that, Eclipse still gives me warnings: "Call requires API level 11 (current min is 7)". What I want is to have my minimum version set to something lower than Honeycomb, have the above conditional statement protect me from running new code on old devices, and <em>not</em> have compiler warnings. </p>

<p>How do I do it?</p>
