当试图让用户更改他/她的电子邮件地址时,Firebase会出错。没有错误的无效电子邮件或密码,但默认错误消息(第三个Toast消息“发生错误”)。 在应用程序的logcat中没有错误。它说“成功”。 Firebase中出现错误的原因是什么?
mFirebaseRef = new Firebase(Constants.FIREBASE_URL);
mFirebaseRef.changeEmail(email, mail, password, new Firebase.ResultHandler() {
@Override
public void onSuccess() {
Toast.makeText(getActivity(), "email address is changed!", Toast.LENGTH_LONG).show();
}
@Override
public void onError(FirebaseError firebaseError) {
// error encountered
switch (firebaseError.getCode()) {
case FirebaseError.USER_DOES_NOT_EXIST:
Toast.makeText(getActivity(), "unknown user", Toast.LENGTH_LONG).show();
break;
case FirebaseError.INVALID_PASSWORD:
Toast.makeText(getActivity(), "invalid password", Toast.LENGTH_LONG).show();
break;
default:
Toast.makeText(getActivity(), "an error occured", Toast.LENGTH_LONG).show();
break;
}
}
});