Is reflection necessary if I use "if (android.os.Build.VERSION.SDK_INT>=11)"
<p>I'm working on an app that targets API 11 (3.0) but minSDKVersion is 7 (2.1).</p>

<p>I generate my PreferenceActivity programmatically instead of with XML.  In Honeycomb, preference layouts have a built-in spot for an icon that can go next to each preference. You can set it with <code>prefScreen.setIcon(R.drawable.my_icon);</code></p>

<p>So I don't want to do this on API 7-10. Is this sufficient protection from crashes?</p>

<pre><code>if (android.os.Build.VERSION.SDK_INT&gt;=11)
    prefScreen.setIcon(R.drawable.myIcon);
</code></pre>

<p>The more elaborate solution that I know is safe is to use reflection to check if that method exists before trying to use it.</p>
