I have an AndroidViewClient script that is testing an activity. Clicking a button in my android app creates a new Activity instance. It seems like the ViewClient instance in my python script needs to be recreated after the new activity is launched - is that right? Something like this:
# My main activity is started here.
vc = ViewClient(device, serialno)
myBtn = vc.findViewById("btnStartNewActivity")
myBtn.touch() # this starts a new activity.
time.sleep(5)
# It seems like ViewClient is still pointing at
# the previous activity.
vc.traverse()
# I can do this to get it to see the new Activity:
vc = ViewClient(device, serialno)
vc.traverse() # now it's ok.
Is that the correct way to do it?
Thanks