fire base how to keep user log in even when close and reopen app using firebaseuser android studio code example
Example: restrict the user from going to signup or login page if the user is already logged in firebase auth
var user = firebase.auth().currentUser;
if (user) {
// User is signed in.
} else {
// No user is signed in.
}