getCurrentUser() functions error
问题 FirebaseUser currentFirebaseUser = FirebaseAuth.getInstance().getCurrentUser(); currentFirebaseUser.getDisplayName(); this code works with all get functions when auth with google but when auth with facebook i get nullPointerException. i check for user using this code if (FirebaseAuth.getInstance().getCurrentUser() == null) { goToLoginScreen(); } else{ String uid = FirebaseAuth.getInstance().getCurrentUser().getUid(); } 回答1: The documentation for getCurrentUser() says that it will, in fact,