Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@TargetApi(Build.VERSION_CODES.GINGERBREAD) What does this code in android indicates

Tags:

android

I'm developing an android app in eclipse. My ide shows a tip to generate this line.I added it to my code:

@TargetApi(Build.VERSION_CODES.GINGERBREAD) 

What does this code indicate? Will the app be restricted with the GINGERBREAD version alone?

like image 469
Arun Avatar asked Jul 20 '13 12:07

Arun


1 Answers

Indicates that Lint should treat this type as targeting a given API level, no matter what the project target is(It just suppress the Lint error)

via Android documentation

e.g. if Lint detects that you are using something newer than your android:minSdkVersion, but up to API Level GingerBread, Lint will not complain.

like image 177
M G Avatar answered Dec 01 '22 03:12

M G