I have an issue where I am using google sign in for my application + Firebase.
Suppose there are 3 users X,Y and Z
with whom I am login in my applicatio
From the docs:
When a user signs up or signs in, that user becomes the current user of the Auth instance. The Firebase Auth instance persists the user's state, so that refreshing the page (in a browser) or restarting the application doesn't lose the user's information.
When the user signs out, the Auth instance stops keeping a reference to the User object and no longer persists its state; there is no current user. However, the user instance continues to be completely functional: if you keep a reference to it, you can still access and update the user's data.
So to solve this, the best way is to create a button and sign out the user. That way that user won't be logged in when you restart the application.
FirebaseAuth.getInstance().signOut();
More info here: https://firebase.google.com/docs/auth/users
Also this question related to ios (but same idea): Firebase - Deleting and reinstalling app does not un-authenticate a user
Some other alternatives also:
adding android:allowBackup="false"
in your <application>
in manifest.
android:allowBackup
Whether to allow the application to participate in the backup and restore infrastructure. If this attribute is set to false, no backup or restore of the application will ever be performed, even by a full-system backup that would otherwise cause all application data to be saved via adb. The default value of this attribute is true.
Do this as a Test:
It is important to have FirebaseAuth.getInstance().signOut();
when logging out.