I haven't written tests for activity handling, so I really don't know this (but I have to ask): is there any other way to detect that an activity has been activated? This approach seems kind of brittle, and I'm wondering if you might be able to detect this in the same way a user would by, for example, ensure that the Activity "handler" view has been created (maybe by switching frames).