Commit ddd9ff84 authored by justin's avatar justin

解决Top页面在绑定engine 后,被底下页面detach engine ,导致白屏问题卡死问题

parent 662e2aa4
......@@ -66,6 +66,14 @@ public class ContainerRecord implements IContainerRecord {
return mState;
}
@Override
public boolean isLock(){
IContainerRecord record=mManager.getCurrentTopRecord();
if(record==this ||record==null ) return false;
return true;
}
@Override
public void onCreate() {
Utils.assertCallOnMainThread();
......@@ -211,6 +219,7 @@ public class ContainerRecord implements IContainerRecord {
}
}
private void appear() {
invokeChannelUnsafe("didShowPageContainer",
mContainer.getContainerUrl(),
......
......@@ -23,6 +23,7 @@ import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.Utils;
import com.idlefish.flutterboost.XFlutterView;
import com.idlefish.flutterboost.XPlatformPlugin;
import com.idlefish.flutterboost.interfaces.IContainerRecord;
import com.idlefish.flutterboost.interfaces.IFlutterViewContainer;
import com.idlefish.flutterboost.interfaces.IOperateSyncer;
import io.flutter.Log;
......@@ -164,6 +165,8 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public void onResume() {
if(mSyncer.isLock()) return;
mSyncer.onAppear();
Log.v(TAG, "onResume()");
......@@ -196,7 +199,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public void onPause() {
Log.v(TAG, "onPause()");
if(mSyncer.isLock()) return;
ensureAlive();
mSyncer.onDisappear();
flutterEngine.getLifecycleChannel().appIsInactive();
......
......@@ -5,6 +5,7 @@ import android.content.Intent;
import java.util.Map;
public interface IOperateSyncer {
boolean isLock();
void onCreate();
......@@ -29,4 +30,5 @@ public interface IOperateSyncer {
void onTrimMemory(int level);
void onLowMemory();
}
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