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
The example on the website using the annotation in the middle of the code is simply wrong (or maybe outdated). The declaration of the annotation itself shows that it is only allowed for types, methods and constructors:
/** Indicates that Lint should treat this type as targeting a given API level, no matter what the
project target is. */
@Target({TYPE, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
public @interface TargetApi {
/**
* This sets the target api level for the type..
*/
int value();
}