Commit 1720a621 authored by yangwu.jia's avatar yangwu.jia

防止空指针

parent 5cf61fe7
...@@ -217,12 +217,16 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -217,12 +217,16 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
ensureAlive(); ensureAlive();
BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry(); BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry();
if (registry != null) {
ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding(); ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding();
if (binding != null && (binding.getActivity() == this.host.getActivity())) { if (binding != null && (binding.getActivity() == this.host.getActivity())) {
registry.getRegistrarAggregate().onDetachedFromActivityForConfigChanges(); registry.getRegistrarAggregate().onDetachedFromActivityForConfigChanges();
flutterEngine.getActivityControlSurface().detachFromActivityForConfigChanges(); flutterEngine.getActivityControlSurface().detachFromActivityForConfigChanges();
} }
}
flutterView.release(); flutterView.release();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment