Commit c6cbdeb0 authored by yangwu.jia's avatar yangwu.jia

native和flutter生命周期同步

parent c159c0f3
...@@ -230,7 +230,7 @@ public class BoostFlutterView extends FrameLayout { ...@@ -230,7 +230,7 @@ public class BoostFlutterView extends FrameLayout {
public void onResume() { public void onResume() {
Debuger.log("BoostFlutterView onResume"); Debuger.log("BoostFlutterView onResume");
mFlutterEngine.getLifecycleChannel().appIsResumed(); // mFlutterEngine.getLifecycleChannel().appIsResumed();
} }
// public void onPostResume() { // public void onPostResume() {
...@@ -240,12 +240,12 @@ public class BoostFlutterView extends FrameLayout { ...@@ -240,12 +240,12 @@ public class BoostFlutterView extends FrameLayout {
public void onPause() { public void onPause() {
Debuger.log("BoostFlutterView onPause"); Debuger.log("BoostFlutterView onPause");
mFlutterEngine.getLifecycleChannel().appIsInactive(); // mFlutterEngine.getLifecycleChannel().appIsInactive();
} }
public void onStop() { public void onStop() {
Debuger.log("BoostFlutterView onStop"); Debuger.log("BoostFlutterView onStop");
mFlutterEngine.getLifecycleChannel().appIsPaused(); // mFlutterEngine.getLifecycleChannel().appIsPaused();
} }
public void onAttach() { public void onAttach() {
......
...@@ -171,12 +171,16 @@ public abstract class BoostFlutterActivity extends Activity implements IFlutterV ...@@ -171,12 +171,16 @@ public abstract class BoostFlutterActivity extends Activity implements IFlutterV
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
mSyncer.onAppear(); mSyncer.onAppear();
mFlutterEngine.getLifecycleChannel().appIsResumed();
} }
@Override @Override
protected void onPause() { protected void onPause() {
mSyncer.onDisappear(); mSyncer.onDisappear();
super.onPause(); super.onPause();
mFlutterEngine.getLifecycleChannel().appIsInactive();
} }
@Override @Override
......
...@@ -83,12 +83,16 @@ abstract public class BoostFlutterFragment extends Fragment implements IFlutterV ...@@ -83,12 +83,16 @@ abstract public class BoostFlutterFragment extends Fragment implements IFlutterV
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
mSyncer.onAppear(); mSyncer.onAppear();
mFlutterEngine.getLifecycleChannel().appIsResumed();
} }
@Override @Override
public void onPause() { public void onPause() {
mSyncer.onDisappear(); mSyncer.onDisappear();
super.onPause(); super.onPause();
mFlutterEngine.getLifecycleChannel().appIsInactive();
} }
@Override @Override
......
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