1

I am using FirebaseAuth.instance.signOut() in my code to logout from firebase but it closes the app entirely after logging out. This is the snippet of code I am using to logout of my app.

mLogout = (Button) findViewById(R.id.logout);
        mLogout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                    FirebaseAuth.getInstance().signOut();
                    Intent intent = new Intent(CustomerMapActivity.this, MainActivity.class);
                    startActivity(intent);
                    finish();
                    return;            }
        });

The app work perfectly without FirebaseAuth.instance.signOut(). Can someone help me please

I want to get some solution to my problem. It would really help me a lot as this is the only problem in my app.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Asghar Ali
  • 11
  • 1
  • 2
    Do you have any auth state listeners in your code elsewhere that might be triggering when the user signs out? Please edit the question to show all relevant auth code. – Doug Stevenson May 07 '23 at 13:42
  • It sounds like your app crashes. When an app crashes, it writes an error message and stack trace to its logcat. Please find those, and add them to your question by clicking the `edit` link under it. Also see https://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this and https://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors – Frank van Puffelen May 07 '23 at 13:52
  • Please edit your question and add the information Frank asked for, and please also respond using @. – Alex Mamo May 08 '23 at 06:15

0 Answers0