M Jesse M Jesse - 10 months ago 56
Android Question

Android: Detect when an activity returns to the previous activity

I have activity A with a listView, a user clicks on any item which starts Activity B. Depending on what the user does in activity B may change the listView on activity A.

So my question:

How can I tell activity A that it was resumed when the user returns to it from activity B?

I want to be able to signal a refresh of the listView in activity A when it is returned to.



You can add the code to refresh listview in the onResume() of Activity A.

protected void onResume() {
    //Code to refresh listview