Thanks P.T. for what looks like the correct answer to question Building multi-SDK Android apps in Eclipse without losing compile-time checks. However, when I try to use the @Ta
FizzBuzz provided the answer to this in How do you version code in Android without compiler warnings?.
In addition to the @TargetApi(nn)
annotation in the code, you also need to import the definition of that annotation:
import android.annotation.TargetApi;
For some unknown reason, an import is not required to use the @Override
annotation. It would be helpful if the ADT documentation http://tools.android.com/recent/lintapicheck were fixed to eliminate the bogus code example and mention the required import.