title: How to get the current activity name and the previous activity in android?
body: <p>I have two activities in my Android app code: <code>A</code> and <code>B</code>. I have a function <code>f()</code> inside <code>A</code> which I want to call from <code>A</code>'s <code>onResume()</code> function only when the previous running activity was <code>B</code>, but not in any other cases. How do I know which activity it came from, whether it came from activity <code>B</code> or some other activity?</p>