android - 如何在Android studio中禁用折旧?

标签 android android-studio kotlin timer

我尝试使用函数formatNumber但它已被弃用。如何禁用折旧?或者也许使用任何替代功能?

enter image description here

最佳答案

通常,您不应禁用方法的弃用标志。在大多数情况下,给定方法的 KDoc/Javadoc 解释了您应该使用什么来代替已弃用的方法。

弃用意味着什么? (官方Java文档)

A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists.

尽管您可以禁用弃用标志 在方法签名级别添加注释:

@Suppress("DEPRECATION")
fun methodName() {
   ...
   deprecatedMethod()
   ...
}

关于android - 如何在Android studio中禁用折旧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58983231/

相关文章:

离开 Activity 时 Android Map Activity 崩溃 [致命信号 11 (SIGSEGV)]

sdk - Android SDK 管理器 - 无法删除 4.4W (API20) 包

android - 如何将android中的动画链接到同一个 View ?

android - 应用程序中的Rock,Paper,Scissors进度

android - 动态替换 fragment 而不是在按钮单击或方向更改时

java - kotlin - 平台类型/方法的非空标记

android - Kotlin CoroutineScope 初始化取决于带有自定义 getter 的 CoroutineContext

android - 在 Kotlin 中编写以下代码的更好方法?

android - setText() 不适用于膨胀的 TextView

Android studio 1.1.0 设置 minifyEnabled true 导致应用程序出现问题