質問

I have the following code:

if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1){
     enter_pos.callOnClick();
}

But I still get error from Lint:

Call requires API level 15 (current min is 12): android.widget.Button#callOnClick

Why Lint is still giving error even after I put a check for the API version? I am using

Android Developer Tools
Build: v22.0.5-757759

Under Windows 8. Thanks in advance for any suggestions!

役に立ちましたか?

解決

You should put @SuppressLint("NewApi") above the method you are using this. Lint cannot decide if you do your check right by looking at your code

他のヒント

In your eclipse Window -> preferences -> Android -> Lint error checking uncheck the two check boxes and apply changes and then clean the project.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top