gpt4 book ai didi

android - 构造函数引用缺失的类型上下文

转载 作者:太空宇宙 更新时间:2023-11-03 11:32:05 24 4
gpt4 key购买 nike

我用下面的构造函数写了一个类

public CustomDialog(Context context)

但是当我尝试在我的 Activity 中这样做时

CustomDialog diag = new CustomDialog(getApplicationContext()){/*stuff here*/};

我得到错误The constructor CustomDialog(Context) references the missing type Context

这是什么意思?我该如何解决?

最佳答案

以防其他人遇到此问题:我遇到了一些从 Play Licensing 库调用方法的代码的相同问题。我通过在 Play Licensing 项目(而不是出现错误的项目)上使用 Project > Clean 来修复它。

关于android - 构造函数引用缺失的类型上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17255490/

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