为什么Android Studio不给newapi警告? [英] Why android studio is not giving newapi warning?
问题描述
我的项目的minSdkVersion是15,targetSdkVersion 26和compileSdkVersion27.我使用的是最新的android studio.但是当我在活动内部调用isDestroyed()
时,android studio并未给出newApi
警告.在API级别17中添加了isDestroyed()
.我的活动扩展了AppCompatActivity
.我的问题类似于此问题,但它没有.没有答案.
My project's minSdkVersion is 15, targetSdkVersion 26 and compileSdkVersion 27. I'm using the latest android studio. But when I call isDestroyed()
inside activity android studio is not giving newApi
warning. isDestroyed()
was added in api level 17. My activity extends AppCompatActivity
. My question is similar to this question, but it doesn't have answer.
推荐答案
转到文件->设置->编辑器->检查-> Android->棉绒->正确性并检查Calling new methods on older versions
.
Go to File --> Settings --> Editor --> Inspection --> Android --> Lint --> Correctness and check Calling new methods on older versions
.
这篇关于为什么Android Studio不给newapi警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!