下图显示了Firebase代码段,用于在我的应用程序用户注册时向他们发送电子邮件验证。
图像中突出显示的区域发出以下警告:
Unchecked assignment: 'anonymous com.google.android.gms.tasks.OnCompleteListener' to 'com.google.android.gms.tasks.OnCompleteListener<java.lang.Void>' less... (Ctrl+F1)
Signals places where an unchecked warning is issued by the compiler, for example:
void f(HashMap map) {
map.put("key", "value");
}
Hint: Pass -Xlint:unchecked to javac to get more details.
我无法解释该警告。我如何摆脱这个警告?任何帮助将不胜感激。
最佳答案
new OnCompleteListener()
应替换为
new OnCompleteListener<AuthResult>()