作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个关于开发环境设置的问题。 我正在尝试查看是否有可能在 开发环境 (eclipse,android studio)
中为使用已弃用功能的 android 应用程序发出编译警告(可以是方法、构造函数或任何你能考虑到 )。直到现在我都在手动寻找这个已弃用功能的用途,我的老板让我在我的想法中寻找一个自动设置......
所以让我们说一个特定的代码:
protected void onPrepareDialog(int paramInt, Dialog paramDialog)
{
try
{
super.onPrepareDialog(paramInt, paramDialog);
AlertDialog localAlertDialog = (AlertDialog)paramDialog;
localAlertDialog.setTitle("Passphrase required");
((TextView)localAlertDialog.findViewById(2131230727)).setText(Preferences.getConfigName(this, getConfigFile()));
Button localButton = localAlertDialog.getButton(-3);
if (this.mOpenVpnService != null);
for (boolean bool = true; ; bool = false)
{
localButton.setEnabled(bool);
return;
}
我这里有几个不赞成使用的功能,android studio 声明了它,但我需要的是一个配置,使这个警告自动进行,并省去我手动遍历每个类的需要......
最佳答案
选择分析 > 检查代码 对您的项目运行 lint。它应该检测任何已弃用的方法,以及项目中的其他常见错误。
您可以选择“按名称运行检查”,在那里您可以找到“已弃用的 API 使用”(Java/代码成熟度问题)。
关于android - 编译时弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27705085/
我是一名优秀的程序员,十分优秀!