Good day!
I think every "more or less" Android developer saw this scheme:

This is a stack of activities. The figure shows what happens when a new activity starts. So, when studying a single Android application, I ran into a problem. The problem is that I need to somehow get the name of the most privileged activity (the one on the top of the stack). But how to do it? You just need to get the name of the activity that is currently on top of all. I will be glad to any help (any way).
Thank)