【发布时间】:2019-10-07 20:58:35
【问题描述】:
mFirebaseAuth.createUserWithEmailAndPassword(email, pass).addOnCompleteListener(TeacherLogin.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
//getting current user and saving student info
try {
FirebaseUser user = mFirebaseAuth.getCurrentUser();
databaseReference = FirebaseDatabase.getInstance().getReference();
databaseReference.child(user.getUid()).push().setValue(teacherInfo);
Toast.makeText(TeacherLogin.this, "succesfully signup", Toast.LENGTH_SHORT).show();
}catch (Exception e) {
Log.e("Exception is", e.toString());
}
【问题讨论】:
-
没有将孩子添加到数据库树但显示“成功注册” ....请帮助我
-
向您展示 TeacherInfo 类。您在 logcat 中看到任何异常吗?
-
public class TeacherInfo { private String name,department,phone,password,email; ArrayList
主题; public TeacherInfo(){ } public TeacherInfo(String name, String department, String phone, String email,String password) { this.name = name; this.department = 部门; this.phone = 电话; this.email = 电子邮件; this.password=密码; } -
logcat 没有异常
-
Log.e("Exception is", e.toString());是否在 logcat 中打印某些内容?也请回复@AlexMamo
标签: java android firebase-realtime-database firebase-authentication