I'm making a chat app with different ways to chat (group chat, chat roulette, etc.)
For some of these different Activities, I need them to call a function which is specific to the activity it lives in whenever the user decides to leave ( such as disconnectFromGroupChat()
or disconnectFromChatRoulette()
).
For example, I currently call these functions when the user clicks my "Leave" button or back button on the phone.
But I realized I don't handle this for notification clicks that take me to a new activity.
How do I handle this?
I found this answer, but in all honesty I don't quite understand it so I'm not sure if that's the right approach to take.