What a joy is to have clean-code reviewers!

I can't think of a better solution. As far as I have seen, when passing from an activity `a1` to another `a2`, `a2.onStart` is called before `a1.onStop` so `startedActivities` doesn't reach 0 in the transition. That means we could avoid the sleep trick and just check whether `startedActivities` is 0. But I am not really sure about that; I don't know if we can always count on `a2.onStart` being called before `a1.onStop`.