'firebase automatic login problem when authentication does not exist

I'm making login function. I want to add automatic login. So, I referenced the code below.

if (currentUser != null) {
    Log.d(TAG,"");
    /* Intent  */
}else{
    Log.d(TAG,"");
}

For testing, I deleted user from firebase authentication console. I expected the automatic login to fail, but it wasn't.

It seems that there is cache memory remaining. If I clear the cache memory, automatic login may not work.

So, I want to add function to know user has authentication to automatic login.

Any other method is fine. I'd appreciate it if you could tell me how to do it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source