I'd like to display Toast
when the user makes logout
.
I have this structure:
WithinConexaoFirebase
,IhaveamethodcalledlogOut
:
publicstaticvoidlogOut(){firebaseAuth.signOut();}
andwithintheclassPerfilActivity
,IhaveamethodthatcallslogOut()
:
privatevoideventoClicks(){btnLogOut.setOnClickListener(newView.OnClickListener(){@OverridepublicvoidonClick(Viewv){ConexaoFirebase.logOut();finish();}});}
IwouldlikeeverytimeImadelogout
todisplayaToast
,soItriedthefollowing:
WithinConexãoFirebase
,Icreatedamethodcalledalert
:
privatevoidalert(Strings){Toast.makeText(getApplicationContext(),s,Toast.LENGTH_SHORT).show();}
andwithinlogOut
Icalledalert
passingthemessagethatIwanttobedisplayed,butmycodegoterror:
What is the correct way to display the message?
I know I could do Toast
within CadastrarActivity
, but I would like to do within the ConexaoFirebase
class.