Closed GoogleCodeExporter closed 9 years ago
Thanks for reporting this. This is a known bug that is was introduced in the
Android platform after 3.0. If you try your test case on 2.3 you will see that
it works.
It seems as if you have been analyzing this issue quite a bit, do you have a
proposed fix (that can be done from Robotium side)? Or can this only be fixed
by the Android team?
Original comment by renasr...@gmail.com
on 6 Apr 2012 at 7:48
A workaround would be to maintain an internal stack of activities. This should
work like this:
1.-Create a timer with a period small enough to catch all the activities and
add every new activity to the internal stack(We would continue using the
monitor getLastActivity for this purpose).
2.-Rewrite the goBack() method to store the lastDestroyedActivity and take out
the top of the stack before calling goBack() method actual code.
3.-Before adding a new activity we would check if the monitor getLastActivity
is different of lastDestroyedActivity, if yes the we add the activity to the
internal stack, if not we don't add it.
4.-Rewrite getCurrentActivity method to return the peek of the stack.
5.-Rewrite getAllOpenedActivities to return the internal stack (This should fix
another bug with goBackToActivity not being able to find an Activity).
If you think this a good workaround I could code it, just let me know.
Original comment by frdc...@gmail.com
on 6 Apr 2012 at 5:52
Sounds like a good workaround. Please code it and perform a pull request in
github.
Original comment by renasr...@gmail.com
on 6 Apr 2012 at 5:56
This has been fixed in Robotium 3.2.
Original comment by renasr...@gmail.com
on 10 Apr 2012 at 6:46
Original issue reported on code.google.com by
frdc...@gmail.com
on 5 Apr 2012 at 7:35