android - Android Activity Lifecycle 中的 Flutter configureFlutterEngine 方法
问题描述
在Android生命周期中究竟何时调用configureFlutterEngine()方法?在onCreate()中?
解决方案
According to official Flutter API docs found in this link :
This method is called after the given FlutterEngine has been attached to the owning FragmentActivity.
The FlutterEngine is the container through which Dart code can be run in an Android application.
An explanation 'attached to the owning FragmentActivity' : Once an Activity is created, and its associated FlutterEngine is executing Dart code, the Activity should invoke this method. At that point the FlutterEngine is considered "attached" to the Activity and all ActivityAware plugins are given access to the Activity.
推荐阅读
- python - sqlalchemy 将两个表连接在一起
- kotlin - 通用约束作为类型列表?还是编译时鸭子类型?
- python - 我想在 django-rest-framework 中创建一个评论功能
- netsuite - 为什么定价搜索不返回有价格的项目的结果?
- java - 使用 Room 加载复杂的数据结构(带有关系和继承)
- multi-tenant - EF Core 迁移 - 多个数据库
- c# - 将时间执行计算为单独的类,其中函数是可变的
- c - For循环没有做预期的事情
- javascript - 添加延迟(同步)与除 IE 之外的现代浏览器一起使用
- windows - 如何在 Windows 上记录我的 Cypress 测试?