【问题标题】:Getting error while defining Toast. Can we mix .android and .androidx libraries together? [closed]定义 Toast 时出错。我们可以将 .android 和 .androidx 库混合在一起吗? [关闭]
【发布时间】:2021-07-01 17:47:34
【问题描述】:

以下函数都不能使用提供的参数调用:

public open fun makeText(context: Context!, text: CharSequence!, duration: Int): 
Toast! defined in android.widget.Toast
public open fun makeText(context: Context!, resId: Int, duration: Int): Toast! defined in android.widget.Toast

【问题讨论】:

    标签: android android-toast


    【解决方案1】:

    您使用错误的参数调用 makeText() 函数。
    如果您为相同数量的参数重载了函数,但使用错误的类型参数调用它,您将遇到此错误。在这种情况下,有 2 个函数有 3 个参数。

    【讨论】:

      猜你喜欢
      • 2019-04-28
      • 2021-12-25
      • 2023-03-22
      • 2014-08-28
      • 1970-01-01
      • 1970-01-01
      • 2012-05-27
      • 1970-01-01
      相关资源
      最近更新 更多