我正在尝试在AlertDialog.Builder
的{{1}}方法中放置一些代码。
问题是我收到以下错误:builder.setPositiveButton
以下是代码:
Cannot resolve method 'addOnCompletionListener(anonymous android.content.DialogInterface.OnClickListener, anonymous com.google.android.gms.tasks.OnCompletionListener<com.google.firebase.auth.AuthResult>)
这里有什么问题?
请告诉我。
答案 0 :(得分:22)
addOnCompleteListener(this, new OnCompleteListener<AuthResult>()
&#34;这&#34;在这一行中意味着你的DialogInterface.OnClickListener,你应该检查这个方法需要什么类型的params,如果是Context,试着把它改成这个
addOnCompleteListener(YourActivityName.this, new OnCompleteListener<AuthResult>()
答案 1 :(得分:3)