Commit 68b8a0d0 authored by yangwu.jia's avatar yangwu.jia

解决空指针问题

parent 86dca9fb
...@@ -33,6 +33,7 @@ import android.view.Gravity; ...@@ -33,6 +33,7 @@ import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeProvider;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
...@@ -46,12 +47,13 @@ import java.util.List; ...@@ -46,12 +47,13 @@ import java.util.List;
import io.flutter.embedding.android.FlutterView; import io.flutter.embedding.android.FlutterView;
import io.flutter.plugin.platform.PlatformPlugin; import io.flutter.plugin.platform.PlatformPlugin;
import io.flutter.view.AccessibilityBridge;
public class BoostFlutterView extends FrameLayout { public class BoostFlutterView extends FrameLayout {
private BoostFlutterEngine mFlutterEngine; private BoostFlutterEngine mFlutterEngine;
private FlutterView mFlutterView; private XFlutterView mFlutterView;
private PlatformPlugin mPlatformPlugin; private PlatformPlugin mPlatformPlugin;
...@@ -116,7 +118,7 @@ public class BoostFlutterView extends FrameLayout { ...@@ -116,7 +118,7 @@ public class BoostFlutterView extends FrameLayout {
mPlatformPlugin = new PlatformPlugin((Activity) getContext(), mFlutterEngine.getPlatformChannel()); mPlatformPlugin = new PlatformPlugin((Activity) getContext(), mFlutterEngine.getPlatformChannel());
mFlutterView = new FlutterView(getContext(), getRenderMode(), getTransparencyMode()); mFlutterView = new XFlutterView(getContext(), getRenderMode(), getTransparencyMode());
addView(mFlutterView, new FrameLayout.LayoutParams( addView(mFlutterView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
...@@ -295,6 +297,10 @@ public class BoostFlutterView extends FrameLayout { ...@@ -295,6 +297,10 @@ public class BoostFlutterView extends FrameLayout {
Debuger.log("BoostFlutterView onDestroy"); Debuger.log("BoostFlutterView onDestroy");
mFlutterView.removeOnFirstFrameRenderedListener(mOnFirstFrameRenderedListener); mFlutterView.removeOnFirstFrameRenderedListener(mOnFirstFrameRenderedListener);
AccessibilityBridge bridge=mFlutterView.getAccessibilityBridge();
if(bridge!=null){
bridge.release();
}
} }
//混合栈的返回和原来Flutter的返回逻辑不同 //混合栈的返回和原来Flutter的返回逻辑不同
......
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