当我在我的应用程序上做某事时,我看到我的应用程序上的导航抽屉减小了它的大小.但是我没有做任何事情.
然后,在检查代码后,我看到不推荐使用setDrawerListener.有人有解决方案吗?任何帮助都可以.先感谢您!
drawerLayout.setDrawerListener(actionBarDrawerToggle);
Run Code Online (Sandbox Code Playgroud) 我已经升级到targetSdkVersion和。compileSdkVersion33
我现在收到一条警告,告诉我onBackPressed已被弃用。
我看到建议使用android.window.OnBackInvokedCallback或androidx.activity.OnBackPressedCallback来处理后退导航。任何人都可以帮助我使用更新的方法吗?
我在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
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
我的服务器正在运行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) "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
我刚刚在库模块中注意到,该模块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)
单击时,人们可能会注意到它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)
如何让它在没有弃用警告的情况下构建?
我正在升级我们的REST API端点,并且我想在他们调用要弃用的端点时通知客户端.
我应该在响应中使用哪个标头,并显示"此API版本已被弃用,请参阅最新文档以更新您的终端"的消息
所以我的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()"收到错误.
那么,你会如何应对呢?
我正在使用已弃用的方法为 Javascript API 编写打字稿定义。这是文档的摘录(他们说 API 但它只是关于这种单一方法):
此 API 无效。出于兼容性目的而对其进行了维护。
出于兼容性目的,我还想在定义文件中记录此方法。但如果可能的话,我想以某种方式传达它已被弃用。
虽然我当前的问题只是关于定义文件中的弃用,但我也想在其他代码中使用此功能。所以问题更普遍:如何在打字稿中将某些内容标记为已弃用?
deprecated typescript deprecation-warning typescript-definitions
我刚刚更新到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) android ×5
deprecated ×3
django ×1
drawerlayout ×1
http ×1
kotlin ×1
material-ui ×1
navigation ×1
php ×1
python ×1
reactjs ×1
rest ×1
strict-mode ×1
typescript ×1
webview ×1
wordpress ×1