{"action":"created","issue":{"url":"https://api.github.com/repos/AppGyver/steroids/issues/913","labels_url":"https://api.github.com/repos/AppGyver/steroids/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/AppGyver/steroids/issues/913/comments","events_url":"https://api.github.com/repos/AppGyver/steroids/issues/913/events","html_url":"https://github.com/AppGyver/steroids/issues/913","id":69675888,"number":913,"title":"Rejected layer push – The specified child already has a parent","user":{"login":"poppahorse","id":5120660,"avatar_url":"https://avatars.githubusercontent.com/u/5120660?v=3","gravatar_id":"","url":"https://api.github.com/users/poppahorse","html_url":"https://github.com/poppahorse","followers_url":"https://api.github.com/users/poppahorse/followers","following_url":"https://api.github.com/users/poppahorse/following{/other_user}","gists_url":"https://api.github.com/users/poppahorse/gists{/gist_id}","starred_url":"https://api.github.com/users/poppahorse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poppahorse/subscriptions","organizations_url":"https://api.github.com/users/poppahorse/orgs","repos_url":"https://api.github.com/users/poppahorse/repos","events_url":"https://api.github.com/users/poppahorse/events{/privacy}","received_events_url":"https://api.github.com/users/poppahorse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-20T20:41:40Z","updated_at":"2015-08-03T11:01:57Z","closed_at":"2015-04-22T11:56:28Z","body":"Trying to start or launch a view from a push notification, but getting the following error\r\n```\r\nsupersonic.logger.error: supersonic.ui.layers.push rejected: {}\r\nPossibly unhandled Error: The specified child already has a parent. You must call removeView() on the child's parent first.\r\n    at FreshAndroidBridge.steroids.layers.push.onFailure (http://localhost/components/supersonic/supersonic.js:29000:29)\r\n    at Object.send.callbacks.failure (http://localhost/components/steroids-js/steroids.js:101:40)\r\n    at Object.callbacks.(anonymous function) (http://localhost/components/steroids-js/steroids.js:167:42)\r\n    at FreshAndroidBridge.message_handler (http://localhost/components/steroids-js/steroids.js:201:45)\r\n    at FreshAndroidBridge.message_handler (http://localhost/components/steroids-js/steroids.js:3321:59)\r\n    at <anonymous>:1:23\r\n```\r\nhere is what I am doing\r\n```\r\nsupersonic.ui.views.find(pushpay.room).then( function(startedView) {\r\n   if(startedView) {\r\n      supersonic.ui.layers.push(startedView);\r\n      //steroids.layers.push(startedView);\r\n   }\r\n   else {\r\n      var view = new supersonic.ui.View({\r\n         location: \"messages#index\",\r\n         id: \"room-x\"\r\n      });\r\n\t\t\t\r\n      // Starting a view\r\n      view.start().then(function(startedView2) {\r\n         supersonic.ui.layers.push(startedView2);\r\n      });\r\n   }\r\n});\r\n```\r\n\r\nI made a thread here - https://forums.appgyver.com/#!/steroids:rejected-layer-push-the-s and it seems you are unable to find and push a view that has already been pushed, which I am not trying to do, but does that also apply to views that have been started programatically and NOT pushed? \r\n\r\nAlso would pushing a layer across different tab stacks make any difference? Hoping to accomplish the following:\r\n\r\nTab A, controller loads views so that a) certain layers are preloaded and b) so they don't close when you press back\r\nTab B, controller handles push notifications. When push notification is selected, should take the view id from the payload and `find` to see if the layer exists. If exists, push the layer, if not, create it."},"comment":{"url":"https://api.github.com/repos/AppGyver/steroids/issues/comments/127195605","html_url":"https://github.com/AppGyver/steroids/issues/913#issuecomment-127195605","issue_url":"https://api.github.com/repos/AppGyver/steroids/issues/913","id":127195605,"user":{"login":"dantabel","id":3995044,"avatar_url":"https://avatars.githubusercontent.com/u/3995044?v=3","gravatar_id":"","url":"https://api.github.com/users/dantabel","html_url":"https://github.com/dantabel","followers_url":"https://api.github.com/users/dantabel/followers","following_url":"https://api.github.com/users/dantabel/following{/other_user}","gists_url":"https://api.github.com/users/dantabel/gists{/gist_id}","starred_url":"https://api.github.com/users/dantabel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantabel/subscriptions","organizations_url":"https://api.github.com/users/dantabel/orgs","repos_url":"https://api.github.com/users/dantabel/repos","events_url":"https://api.github.com/users/dantabel/events{/privacy}","received_events_url":"https://api.github.com/users/dantabel/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T11:01:57Z","updated_at":"2015-08-03T11:01:57Z","body":"I understand that a webview can only be in the layer stack once, but is there a way to detect whether a view is already in the layer stack or not?\r\n\r\nI have an app that contains posts, and individual posts can be opened from various places in the app. To speed things up I have a pre-loaded webview as a template and the post data gets swapped out when opened. So when I open a post I need to know whether the template is already in use or not so I know whether I can use the template or if I need to start a new view. \r\n\r\nAny help or pointers would be appreciated. Thanks."}}