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

防止空指针

parent 5cf61fe7
...@@ -217,11 +217,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer ...@@ -217,11 +217,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
ensureAlive(); ensureAlive();
BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry(); BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry();
ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding(); if (registry != null) {
if (binding != null && (binding.getActivity() == this.host.getActivity())) { ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding();
registry.getRegistrarAggregate().onDetachedFromActivityForConfigChanges(); if (binding != null && (binding.getActivity() == this.host.getActivity())) {
flutterEngine.getActivityControlSurface().detachFromActivityForConfigChanges();
registry.getRegistrarAggregate().onDetachedFromActivityForConfigChanges();
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