编译时弃用警告

Tub*_*Man 10 eclipse android android-studio

我对开发环境设置有疑问.我试图看看是否有可能在development environment(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;
      }
Run Code Online (Sandbox Code Playgroud)

我在这里有几个不推荐使用的功能,android studio声明它,但我需要的是这个警告的配置是自动化的,并且省去了手动遍历每个类的需要...

Nuw*_*sam 28

选择Analyze> Inspect Code以在项目上运行lint.它应该检测任何已弃用的方法,以及项目中的其他常见错误.

您可以选择"按名称运行检查",在那里您可以找到"不推荐使用的API使用"(Java /代码成熟度问题).

  • 您可以选择"按名称运行检查",在那里您可以找到"不推荐使用的API使用"(Java /代码成熟度问题). (3认同)