Take a look at this thread. I think you want to do a wait until current_activity produces the activity you desire before continuing.