{"action":"created","issue":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/1044","labels_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/1044/labels{/name}","comments_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/1044/comments","events_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/1044/events","html_url":"https://github.com/MvvmCross/MvvmCross/issues/1044","id":91353194,"number":1044,"title":"IMvxAndroidCurrentTopActivity > Activity = null during Fragment.OnCreate()","user":{"login":"IlSocio","id":6009176,"avatar_url":"https://avatars.githubusercontent.com/u/6009176?v=3","gravatar_id":"","url":"https://api.github.com/users/IlSocio","html_url":"https://github.com/IlSocio","followers_url":"https://api.github.com/users/IlSocio/followers","following_url":"https://api.github.com/users/IlSocio/following{/other_user}","gists_url":"https://api.github.com/users/IlSocio/gists{/gist_id}","starred_url":"https://api.github.com/users/IlSocio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IlSocio/subscriptions","organizations_url":"https://api.github.com/users/IlSocio/orgs","repos_url":"https://api.github.com/users/IlSocio/repos","events_url":"https://api.github.com/users/IlSocio/events{/privacy}","received_events_url":"https://api.github.com/users/IlSocio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-26T20:24:38Z","updated_at":"2015-06-27T22:58:24Z","closed_at":null,"body":"Hello everyone, \r\nI think I just found an issue in MVVMCross Fragments and unfortunately, after spending some time on it, I wasn't able to fix it on my own... \r\n\r\nWhen the \"Developers Options > Don't keep activities\" flag is set and the Activity is brought back from background to foreground, in the \"Fragment > OnCreate()\" the IMvxAndroidCurrentTopActivity.Activity should point to the current activity, but it returns null instead :(\r\n\r\nAs my understanding, it happens because the LifeTimeMonitor.OnCreate() is called only after the Activity.OnCreate() has been completed.\r\nSo, when the Fragment.OnCreate() gets called, the LifeTimeMonitor.Activity is still null.\r\nThe LifeTimeMonitor.OnCreate() should be called after the Activity.OnCreate and before the Fragment.OnCreate()\r\nBut I don't know how to properly fix it...\r\n\r\nThe issue affects also the ViewModel side, because since all the CIRS event are called during the View.OnCreate(), it is impossible to safely use any Gui service from a ViewModel during the CIRS...\r\n\r\nDid anyone already face such issue?\r\nMarco."},"comment":{"url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/comments/116164517","html_url":"https://github.com/MvvmCross/MvvmCross/issues/1044#issuecomment-116164517","issue_url":"https://api.github.com/repos/MvvmCross/MvvmCross/issues/1044","id":116164517,"user":{"login":"IlSocio","id":6009176,"avatar_url":"https://avatars.githubusercontent.com/u/6009176?v=3","gravatar_id":"","url":"https://api.github.com/users/IlSocio","html_url":"https://github.com/IlSocio","followers_url":"https://api.github.com/users/IlSocio/followers","following_url":"https://api.github.com/users/IlSocio/following{/other_user}","gists_url":"https://api.github.com/users/IlSocio/gists{/gist_id}","starred_url":"https://api.github.com/users/IlSocio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IlSocio/subscriptions","organizations_url":"https://api.github.com/users/IlSocio/orgs","repos_url":"https://api.github.com/users/IlSocio/repos","events_url":"https://api.github.com/users/IlSocio/events{/privacy}","received_events_url":"https://api.github.com/users/IlSocio/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T22:58:24Z","updated_at":"2015-06-27T22:58:24Z","body":"Because I'm showing a ProgressDialog from the ViewModel, during the ViewModel.OnStart()\r\n\r\n"}}