Android Studio ignore deprecated

元气小坏坏 提交于 2019-12-08 11:54:21

问题


I moved my Eclispe project to Android Studio, but it outputs a lot of deprecated errors when built. I tried some methods, but they don't work.


回答1:


Try placing this at the top of the methods:

@SuppressWarnings("deprecation")

Example

@SuppressWarnings("deprecation")
public void testMethod(){
...
}

For a brief explaination go to this link:

[What is @SuppressWarnings("deprecation") and ("unused") in Android?

Update:

It seems that there is also some known issues with deprecations. You might want to read this for more info:

stackoverflow.com/questions/26921774/how-to-avoid-deprecation-warnings-when-suppresswarningsdeprecation-doesnt



来源:https://stackoverflow.com/questions/37770754/android-studio-ignore-deprecated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!