我想将 setDisplayName() 实现到我的代码中,但不确定如何执行。我应该将 setDisplayName 放在代码中的什么位置?我想在导航栏标题中显示客户名称。
这是我的代码
//create customer
firebaseAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(RegisterActivity.this, new OnCompleteListener < AuthResult > () {
@Override
public void onComplete(@NonNull Task < AuthResult > task) {
if (task.isSuccessful()) {
Customer info = new Customer(name, email, address, number, gender);
FirebaseDatabase.getInstance().getReference("Customer")
.child(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid())
.setValue(info).addOnCompleteListener(new OnCompleteListener < Void > () {
@Override
public void onComplete(@NonNull Task < Void > task) {
regProgressBar.setVisibility(View.VISIBLE);
Toast.makeText(RegisterActivity.this, "Registration Complete", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), Home.class));
}
});
}
}
});
UYOU
相关分类