Commit 1d542e4d authored by justin's avatar justin Committed by GitHub

Merge pull request #637 from Firewayer/fix/fix_tab_fragment

fix多tab情况下,Fragment切换时生命周期未正确同步至Boost的Bug
parents a62aa224 43926214
......@@ -259,14 +259,18 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Override
public void onStart() {
super.onStart();
if (!isHidden()) {
delegate.onStart();
}
}
@Override
public void onResume() {
super.onResume();
if (!isHidden()) {
delegate.onResume();
}
}
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible.
@ActivityCallThrough
......@@ -277,14 +281,18 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Override
public void onPause() {
super.onPause();
if (!isHidden()) {
delegate.onPause();
}
}
@Override
public void onStop() {
super.onStop();
if (!isHidden()) {
delegate.onStop();
}
}
@Override
public void onDestroyView() {
......@@ -300,6 +308,15 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
delegate = null;
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (hidden) {
delegate.onPause();
} else {
delegate.onResume();
}
}
@ActivityCallThrough
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
......
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