gpt4 book ai didi

android - 编译时弃用警告

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:54:25 25 4
gpt4 key购买 nike

我有一个关于开发环境设置的问题。 我正在尝试查看是否有可能在 开发环境 (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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com