How to Delete a Firebase User from Android App?
We have seen in many of the apps that if have the choice to delete the user or can say your account permanently. Here we are going to see how we can implement that in our app and can delete our account permanently from the firebase authentication. Here while writing our code we will remove the user but before that, we will reAuthenticate the user.
Step by Step Implementation
Step 2: Follow all the steps and “Login In” to your android app. Then create a mainmenu.xml file as following
Step 3: Create a new empty activity and name the activity as DeleteUser.
Step 4: Then Go to the MainActivity.java file and refer to the following code. Below is the code for the MainActivity.java file.
Step 5: Working with the activity_deleteuser.xml file
Navigate to the app > res > layout > activity_deleteuser.xml and add the below code to that file. Below is the code for the activity_deleteuser.xml file. We will create two simple EditText and a Button.
Step 4: Working with the DeleteUser.java file
Go to the DeleteUser.java file and refer to the following code. Below is the code for the DeleteUser.java file. Comments are added inside the code to understand the code in more detail.