Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 这(上下文,0)对AlertDialog源代码意味着什么_Java_Android_Methods_This_Android Alertdialog - Fatal编程技术网

Java 这(上下文,0)对AlertDialog源代码意味着什么

Java 这(上下文,0)对AlertDialog源代码意味着什么,java,android,methods,this,android-alertdialog,Java,Android,Methods,This,Android Alertdialog,我正在学习Android框架,想创建自己的自定义对话框,让我可以同时选择日期和时间。我正在查看AlertDialog源代码,构造函数调用此方法(上下文,0)。我经常被“这个”这个词所迷惑。我不确定它在这里作为方法调用时的含义 链接到来源: 此(上下文,0)调用AlertDialog类中的以下构造函数 protected AlertDialog(Context context, @StyleRes int themeResId) { this(context, themeResId, tr

我正在学习Android框架,想创建自己的自定义对话框,让我可以同时选择日期和时间。我正在查看AlertDialog源代码,构造函数调用此方法(上下文,0)。我经常被“这个”这个词所迷惑。我不确定它在这里作为方法调用时的含义

链接到来源:

此(上下文,0)
调用AlertDialog类中的以下构造函数

protected AlertDialog(Context context, @StyleRes int themeResId) {
    this(context, themeResId, true);
}
上述方法创建一个使用显式主题资源的警报对话框。
this()
用于调用类中的另一个构造函数。

关键字引用到当前正在工作的类


this(上下文,0)它实际上调用了AlertDialog构造函数,该构造函数有两个参数。

我没有意识到该构造函数只有一个参数,调用是两个Arumings。我以为它是在递归地调用自己。
protected AlertDialog(Context context, @StyleRes int themeResId) {
    this(context, themeResId, true);
}