为什么Android Studio不给newapi警告? [英] Why android studio is not giving newapi warning?

查看:243
本文介绍了为什么Android Studio不给newapi警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆