{"action":"created","issue":{"url":"https://api.github.com/repos/RobotiumTech/robotium/issues/796","repository_url":"https://api.github.com/repos/RobotiumTech/robotium","labels_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/796/labels{/name}","comments_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/796/comments","events_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/796/events","html_url":"https://github.com/RobotiumTech/robotium/issues/796","id":115827026,"number":796,"title":"Solo.getCurrentActivity() can return wrong activity.","user":{"login":"enikey87","id":1632488,"avatar_url":"https://avatars.githubusercontent.com/u/1632488?v=3","gravatar_id":"","url":"https://api.github.com/users/enikey87","html_url":"https://github.com/enikey87","followers_url":"https://api.github.com/users/enikey87/followers","following_url":"https://api.github.com/users/enikey87/following{/other_user}","gists_url":"https://api.github.com/users/enikey87/gists{/gist_id}","starred_url":"https://api.github.com/users/enikey87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enikey87/subscriptions","organizations_url":"https://api.github.com/users/enikey87/orgs","repos_url":"https://api.github.com/users/enikey87/repos","events_url":"https://api.github.com/users/enikey87/events{/privacy}","received_events_url":"https://api.github.com/users/enikey87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-09T08:01:29Z","updated_at":"2016-06-03T12:03:29Z","closed_at":null,"body":"getCurrentActivity() can return wrong one when activity stack changes very fast.\r\n\r\nFor exampe:\r\n- start ActivityB where onCreate() is { ... recreate() ... }\r\n- waitForActivity(ActivityB.class).\r\n- let wrongActivity = solo.getCurrentActivity(). // can return old destroyed instance of ActivityB.\r\n\r\nIn such cases solo.getCurrentActivity() will never return actual \"current\".\r\n\r\nReason is following execution chain:\r\n- [UiThread]: new ActivityB.onCreate().\r\n- [Instrumentation]: Instrumentation.performOnCreate() { ... monitors.match(old Activity) }\r\n- [UiThread]: old ActivityB.onDestroy().\r\n- [Instrumentation]: Instrumentation.performOnDestroy() { ... monitors.match(new Activity) }\r\n- [ActivityMonitorThread]: waitForActivity() returns destroyed \"old ActivityB\" and \"new ActivityB\" is now lost forever."},"comment":{"url":"https://api.github.com/repos/RobotiumTech/robotium/issues/comments/223561403","html_url":"https://github.com/RobotiumTech/robotium/issues/796#issuecomment-223561403","issue_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/796","id":223561403,"user":{"login":"ArvindAbi","id":14055128,"avatar_url":"https://avatars.githubusercontent.com/u/14055128?v=3","gravatar_id":"","url":"https://api.github.com/users/ArvindAbi","html_url":"https://github.com/ArvindAbi","followers_url":"https://api.github.com/users/ArvindAbi/followers","following_url":"https://api.github.com/users/ArvindAbi/following{/other_user}","gists_url":"https://api.github.com/users/ArvindAbi/gists{/gist_id}","starred_url":"https://api.github.com/users/ArvindAbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArvindAbi/subscriptions","organizations_url":"https://api.github.com/users/ArvindAbi/orgs","repos_url":"https://api.github.com/users/ArvindAbi/repos","events_url":"https://api.github.com/users/ArvindAbi/events{/privacy}","received_events_url":"https://api.github.com/users/ArvindAbi/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T12:03:29Z","updated_at":"2016-06-03T12:03:29Z","body":"I am experiencing the same problem. But for me this is consistently reproducing when I enable **\"Don't Keep Activities**\" in **Developer options** iin the test device. If I disable the dev option. Its working fine for me..\r\n"}}
{"actor":{"display_login":"ArvindAbi"}}