【问题标题】:How is this work @SuppressWarnings("ALL") Android Studio?@SuppressWarnings("ALL") Android Studio 的这项工作如何?
【发布时间】:2021-12-03 03:45:56
【问题描述】:

不使用@suppuressWarnings("all") 查看此错误

注意:(文件路径)\MainActivity3.java 使用或覆盖已弃用的 API。 注意:使用 -Xlint 重新编译:详细信息弃用。

使用@suppuressWarnings("all") 后所有错误都解决了吗?

What can I use this is the Right way??

【问题讨论】:

  • 抑制警告消息并不能解决它们 - 它只是告诉编译器:不要用这些消息打扰我,我不在乎。确实会在一段时间后伤害您:当您更新开发环境并且不推荐使用的方法消失时,您的代码将不再编译。请参阅stackoverflow.com/q/47740812/5646962 了解解决问题的更好方法。
  • 这能回答你的问题吗? Recompile with -Xlint in Android studio

标签: java android android-studio deprecated deprecation-warning


【解决方案1】:

将此用于弃用:

@SuppressWarnings("deprecation")

看看http://blog.bangbits.com/2008/05/suppresswarnings-annotations.html

【讨论】:

  • 好!但我看这扩展了 AppCompatActivity 在 @SuppressWarnings 内工作
猜你喜欢
  • 2013-07-10
  • 1970-01-01
  • 2020-03-29
  • 2013-09-09
  • 2018-09-09
  • 2021-06-24
  • 1970-01-01
  • 1970-01-01
  • 2020-10-29
相关资源
最近更新 更多