{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/11239","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/11239/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/11239/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/11239/events","html_url":"https://github.com/flutter/flutter/issues/11239","id":243127424,"node_id":"MDU6SXNzdWUyNDMxMjc0MjQ=","number":11239,"title":"Provide an easier way to defer starting the app with FlutterActivity","user":{"login":"collinjackson","id":394889,"node_id":"MDQ6VXNlcjM5NDg4OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/394889?v=4","gravatar_id":"","url":"https://api.github.com/users/collinjackson","html_url":"https://github.com/collinjackson","followers_url":"https://api.github.com/users/collinjackson/followers","following_url":"https://api.github.com/users/collinjackson/following{/other_user}","gists_url":"https://api.github.com/users/collinjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/collinjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collinjackson/subscriptions","organizations_url":"https://api.github.com/users/collinjackson/orgs","repos_url":"https://api.github.com/users/collinjackson/repos","events_url":"https://api.github.com/users/collinjackson/events{/privacy}","received_events_url":"https://api.github.com/users/collinjackson/received_events","type":"User","site_admin":false},"labels":[{"id":492041205,"node_id":"MDU6TGFiZWw0OTIwNDEyMDU=","url":"https://api.github.com/repos/flutter/flutter/labels/customer:%20posse%20(eap)","name":"customer: posse (eap)","color":"e99695","default":false},{"id":284438921,"node_id":"MDU6TGFiZWwyODQ0Mzg5MjE=","url":"https://api.github.com/repos/flutter/flutter/labels/engine","name":"engine","color":"003570","default":false},{"id":283479235,"node_id":"MDU6TGFiZWwyODM0NzkyMzU=","url":"https://api.github.com/repos/flutter/flutter/labels/severe:%20new%20feature","name":"severe: new feature","color":"ffff00","default":false},{"id":283479900,"node_id":"MDU6TGFiZWwyODM0Nzk5MDA=","url":"https://api.github.com/repos/flutter/flutter/labels/%E2%96%A3%20platform-android","name":"▣ platform-android","color":"003570","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-14T22:29:48Z","updated_at":"2018-08-07T04:37:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If you're extending `FlutterActivity` you might want to do some processing in Java before starting up the Flutter app. Right now, `FlutterActivity` assumes you want to start the app immediately. You could have a different `Activity` that transitions to the `FlutterActivity`, but that could involve some extra work, and it would be nice to be able to do it in `FlutterActivity`.\r\n\r\nAndroid requires that `onCreate` calls `super.onCreate()`. If `FlutterActivity` had way to call `super.onCreate()` without `eventDelegate.onCreate(savedInstanceState);` (perhaps by exposing the delegate to subclasses or by notifying the `eventDelegate` via protected methods that could be overridden), that would allow subclasses of `FlutterActivity` to delay startup until they are ready for the Flutter app to start.\r\n\r\nI believe the current recommended solution is copy-pasting the entirety of `FlutterActivity`. This works, but it is adding extra boilerplate that might get out of date.\r\n\r\nThis issue is possibly related to #11237 (checking for Google Play Services on startup). It was based on a conversation with @lukef. It sounds like Posse has worked around it already by making their own Activity, so this is just feedback for the next developer who comes along. @lukef, I'm not sure if I correctly accurately the issue you described, so feel free to chime in with more thoughts at your convenience."},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/410930728","html_url":"https://github.com/flutter/flutter/issues/11239#issuecomment-410930728","issue_url":"https://api.github.com/repos/flutter/flutter/issues/11239","id":410930728,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDkzMDcyOA==","user":{"login":"mehmetf","id":6687929,"node_id":"MDQ6VXNlcjY2ODc5Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/6687929?v=4","gravatar_id":"","url":"https://api.github.com/users/mehmetf","html_url":"https://github.com/mehmetf","followers_url":"https://api.github.com/users/mehmetf/followers","following_url":"https://api.github.com/users/mehmetf/following{/other_user}","gists_url":"https://api.github.com/users/mehmetf/gists{/gist_id}","starred_url":"https://api.github.com/users/mehmetf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehmetf/subscriptions","organizations_url":"https://api.github.com/users/mehmetf/orgs","repos_url":"https://api.github.com/users/mehmetf/repos","events_url":"https://api.github.com/users/mehmetf/events{/privacy}","received_events_url":"https://api.github.com/users/mehmetf/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T04:37:07Z","updated_at":"2018-08-07T04:37:07Z","author_association":"CONTRIBUTOR","body":"Thinking out loud here.\r\n\r\nOne way would be to provide all the functionality around a single native object; preferably the lowest level one that add2app developers interact with. That would mean wherever Flutter is used, the *right things happen* at all times. On Android, this construct is a FlutterView but since Views do not really have a lifecycle, it is impossible to provide complete functionality. Fragment might be the right answer. The complication comes in for cases where add2app really wants a view. One example is placing Flutter inside of a RecyclerView. So, in this scenario, how could we handle Flutter functionality that requires hooking into the activity lifecycle?\r\n\r\nThat brings me to the second way which is already halfway implemented: a delegate pattern. Push all Flutter related functionality to FlutterActivityDelegate and leave it up to the host app to do the necessary wiring. We can then provide adequate instructions on how to do wiring for various add2app scenarios involving Activity, Fragment and View. I would then make FlutterActivity in the templates just a shell; the simplest possible incarnation of an actual activity using the delegate."}}
{"actor":{"display_login":"mehmetf"}}