It is working in android studio and managing cell phone authentication in firebase, Can't get user session id in firebase, It works in a first activity but wanting to obtain a second activity is where the problem occurs, and the app closes automatically. The code is in a provider class which is this:
public String getId(){
if(auth.getCurrentUser() != null){
return auth.getCurrentUser().getUid();
}
else{
return null;
}
}
to get the id of the session in another class of an activity I instantiate the provider class and do this:
Provider provider = new Provider();
Log.d("id",provider.getId());
Someone who can tell me what may be happening, thank you in advance.