Lint and old API level warning
<p>I compile against Android 4.2 (API 17), in my Manifest I have:</p>

<pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/&gt;
</code></pre>

<p>In code I use:</p>

<pre><code>String first = sdf.format(new   Date(context.getPackageManager().getPackageInfo(context.getPackageName(), 0).firstInstallTime)); 
</code></pre>

<p>Field firstInstallTime was introduced in API 9.</p>

<p>Lint does not warn me, i.e. that this field is not valid in API 8. What am I missing, how should one detect this? </p>

<p>If I compile against Android 2.2 (API 8), I find the error and a bunch of extra errors due to new features used (> API 8) and the project won't compile.</p>

<p>(I'm aware of handling such things in runtime with for example Build.VERSION.SDK_INT)</p>

<p>What's the best way of working?</p>

<p>Why is lint not working?</p>

<p>Thanks!</p>
