How can I detect if an activity came to focus after pressing the back button from a child activity, and how can I execute some code at that time?
One possibility would be to start your child activity with startActivityForResult() and implement onActivityResult() which will be called when you return from the child activity.