标签: deprecation-warning

方法setDrawerListener已弃用

当我在我的应用程序上做某事时,我看到我的应用程序上的导航抽屉减小了它的大小.但是我没有做任何事情.

导航抽屉

然后,在检查代码后,我看到不推荐使用setDrawerListener.有人有解决方案吗?任何帮助都可以.先感谢您!

drawerLayout.setDrawerListener(actionBarDrawerToggle);
Run Code Online (Sandbox Code Playgroud)

android drawerlayout deprecation-warning

219
推荐指数
4
解决办法
8万
查看次数

onBackPressed() 已弃用。还有什么选择呢?

我已经升级到targetSdkVersion和。compileSdkVersion33

我现在收到一条警告,告诉我onBackPressed已被弃用。

我看到建议使用android.window.OnBackInvokedCallbackandroidx.activity.OnBackPressedCallback来处理后退导航。任何人都可以帮助我使用更新的方法吗?

例子

onBackPressed已弃用

使用案例

我在onBackPressed()if (isTaskRoot) {}方法内部使用来检查该活动是否是活动堆栈上的最后一个活动。

override fun onBackPressed() {
    if (isTaskRoot) { // Check whether this activity is last on the activity stack. (Check whether this activity opened from a Push Notification.)
        startActivity(Intent(mContext, Dashboard::class.java))
        finish()
    } else {
        finishWithResultOK()
    }
}
Run Code Online (Sandbox Code Playgroud)

navigation android kotlin deprecation-warning android-tiramisu

178
推荐指数
9
解决办法
11万
查看次数

material-ui Drawer - findDOMNode is deprecated in StrictMode

I have a simple ReactJS app based on hooks (no classes) using StrictMode.

I am using React version 16.13.1 and Material-UI version 4.9.10.

In the Appbar I am using Drawer.

    <div className={classes.root}>
        <AppBar position="static">
            <Toolbar>
                <IconButton
                    edge="start"
                    className={classes.menuButton}
                    color="inherit"
                    aria-label="menu"
                    onClick={handleDrawerOpen}>
                    <MenuIcon />
                </IconButton>
                <Typography variant="h6" className={classes.title}>
                    Online Information
                </Typography>
            </Toolbar>
        </AppBar>
        <Drawer
            variant="persistent"
            anchor="left"
            open={open}
        ></Drawer>
    </div>
Run Code Online (Sandbox Code Playgroud)

I notice that when I open the Drawer, I get the following warning.

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed …
Run Code Online (Sandbox Code Playgroud)

strict-mode reactjs deprecation-warning material-ui react-navigation-drawer

123
推荐指数
4
解决办法
6万
查看次数

关闭弃用的错误php 5.3

我的服务器正在运行php 5.3和我的wordpress安装将这些错误吐出来,导致我的session_start()中断.

Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647

Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 662

Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 669

Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 676

Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on …
Run Code Online (Sandbox Code Playgroud)

php wordpress deprecation-warning

121
推荐指数
8
解决办法
21万
查看次数

`shouldOverrideUrlLoading`真的被弃用了吗?我可以用什么呢?

"shouldOverrideUrlLoading"真的被弃用了吗?如果是这样,我可以使用什么呢?

似乎shouldOverrideUrlLoading已经弃用了针对Android N的应用程序,我需要让应用程序自API 19开始工作,直到最新的Android N(测试版),我使用的是Android N中的一些新功能(如Data Saver),因此定位Marshmallow无法解决这个问题,因为我需要使用这些新功能,这是我使用的代码的一部分:

public boolean shouldOverrideUrlLoading(WebView webview, String url) {
    if (url.startsWith("http:") || url.startsWith("https:")) {
        ...
    } else if (url.startsWith("sms:")) {
        ...
    }
    ...
}
Run Code Online (Sandbox Code Playgroud)

这是Android Studio给我的消息:

覆盖'android.webkit.WebViewClient'中不推荐使用的方法此检查报告在指定的检查范围中使用不推荐的代码的位置.

谷歌没有说这种弃用.

我想知道是否使用@SuppressWarnings("deprecation")将让我在API 19上工作直到最新的Android N Beta(及其发布时的最终版本),我无法自己测试,我从未使用过,我需要确定它有效,所以,任何人都能说出来?

android deprecated webview android-webview deprecation-warning

121
推荐指数
3
解决办法
9万
查看次数

buildToolsVersion 和compileSdkVersion 已被弃用

我刚刚在库模块中注意到,该模块compileSdkVersion最近buildToolsVersion已被弃用。这是它抱怨的两种配置(删除文本)。目前这仅影响com.android.library,而不影响com.android.application

plugins {
    id "com.android.library"
}
android {
    defaultConfig {
        compileSdkVersion 31
        buildToolsVersion "31.0.0"
    }
}
Run Code Online (Sandbox Code Playgroud)

截图:build.gradle

单击时,人们可能会注意到它com.android.build.gradle.AndroidConfig已被弃用BaseExtension(无论这对于匹配意味着什么build.gradle):

截图:蕨花


显然compileSdkVersion现在被称为compileSdk(这部分似乎有效)......并且buildToolsVersion必须被定义为属性。但是在构建时(不是我没有尝试过),属性buildToolsVerson = "31.0.0"是未知的:

android {
    defaultConfig {
        compileSdk 31
        buildToolsVersion = "31.0.0"
    }
}
Run Code Online (Sandbox Code Playgroud)

如何让它在没有弃用警告的情况下构建?

android android-gradle-plugin deprecation-warning

97
推荐指数
6
解决办法
4万
查看次数

HTTP响应标头的约定,用于通知客户已弃用的API

我正在升级我们的REST API端点,并且我想在他们调用要弃用的端点时通知客户端.
我应该在响应中使用哪个标头,并显示"此API版本已被弃用,请参阅最新文档以更新您的终端"的消息

rest http http-status-codes deprecation-warning

75
推荐指数
6
解决办法
3万
查看次数

不推荐使用setBackgroundDrawable()

所以我的sdk从15到21,当我打电话时setBackgroundDrawable(),Android Studio告诉我它已被弃用.

我想过用它来绕过它:

int sdk = android.os.Build.VERSION.SDK_INT;

if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) {
    layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.img_wstat_tstorm));
} else {
    layout.setBackground(getResources().getDrawable(R.drawable.img_wstat_tstorm));
}
Run Code Online (Sandbox Code Playgroud)

但是,我在"setBackground()"收到错误.

那么,你会如何应对呢?

android deprecated deprecation-warning

74
推荐指数
6
解决办法
7万
查看次数

是否可以在打字稿中将某些内容标记为已弃用?

我正在使用已弃用的方法为 Javascript API 编写打字稿定义。这是文档的摘录(他们说 API 但它只是关于这种单一方法):

此 API 无效。出于兼容性目的而对其进行了维护。

出于兼容性目的,我还想在定义文件中记录此方法。但如果可能的话,我想以某种方式传达它已被弃用。

虽然我当前的问题只是关于定义文件中的弃用,但我也想在其他代码中使用此功能。所以问题更普遍:如何在打字稿中将某些内容标记为已弃用?

deprecated typescript deprecation-warning typescript-definitions

63
推荐指数
1
解决办法
2万
查看次数

Django 1.9弃用警告app_label

我刚刚更新到Django v1.8,并在更新我的项目之前测试我的本地设置,我有一个我以前从未见过的弃用警告,对我来说也没有任何意义.我可能只是忽略了一些东西或误解了文档.

/Users/neilhickman/Sites/guild/ankylosguild/apps/raiding/models.py:6: RemovedInDjango19Warning: Model class ankylosguild.apps.raiding.models.Difficulty doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Difficulty(models.Model):

/Users/neilhickman/Sites/guild/ankylosguild/apps/raiding/models.py:21: RemovedInDjango19Warning: Model class ankylosguild.apps.raiding.models.Zone doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Zone(models.Model):

/Users/neilhickman/Sites/guild/ankylosguild/apps/raiding/models.py:49: RemovedInDjango19Warning: …
Run Code Online (Sandbox Code Playgroud)

python django deprecation-warning

59
推荐指数
8
解决办法
7万
查看次数