我已经创建了删除用户的代码。我创建了可以删除用户的管理功能。我已经创建了编码,但是后来我意识到只在用户数据库中删除了用户帐户,而未删除身份验证?如何在Firebase上通过身份验证删除用户数据库?
@Override
public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, final int i) {
myViewHolder.email.setText(custList.get(i).getEmail());
myViewHolder.name.setText(custList.get(i).getName());
myViewHolder.telephone_number.setText(custList.get(i).getTelephone_number());
myViewHolder.btnDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String email = custList.get(i).getEmail();
String id = custList.get(i).getId();
DatabaseReference dbCust = FirebaseDatabase.getInstance().getReference("Customer");
dbCust.child(id).removeValue();
//Toolbar
// Remove the item on remove/button click
custList.remove(i);
/*
Parameters
position : Position of the item that has now been removed
*/
notifyItemRemoved(i);
/*
Parameters
positionStart : Position of the first item that has changed
itemCount : Number of items that have changed
*/
notifyItemRangeChanged(i, custList.size());
// Show the removed item label
Toast.makeText(context, email + " has been removed", Toast.LENGTH_SHORT).show();
}
});
}