Commit 79455e07 authored by justin's avatar justin Committed by GitHub

Merge pull request #628 from Firewayer/feature/flutter_boost_init

FlutterBoost防止Init多次
parents bef1c5c8 7c93c172
...@@ -5,6 +5,8 @@ import android.app.Activity; ...@@ -5,6 +5,8 @@ import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Debug;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.idlefish.flutterboost.interfaces.*; import com.idlefish.flutterboost.interfaces.*;
import io.flutter.embedding.android.FlutterView; import io.flutter.embedding.android.FlutterView;
...@@ -27,6 +29,7 @@ public class FlutterBoost { ...@@ -27,6 +29,7 @@ public class FlutterBoost {
private Activity mCurrentActiveActivity; private Activity mCurrentActiveActivity;
private boolean mEnterActivityCreate =false; private boolean mEnterActivityCreate =false;
static FlutterBoost sInstance = null; static FlutterBoost sInstance = null;
private static boolean sInit;
private long FlutterPostFrameCallTime = 0; private long FlutterPostFrameCallTime = 0;
private Application.ActivityLifecycleCallbacks mActivityLifecycleCallbacks; private Application.ActivityLifecycleCallbacks mActivityLifecycleCallbacks;
...@@ -47,7 +50,10 @@ public class FlutterBoost { ...@@ -47,7 +50,10 @@ public class FlutterBoost {
} }
public void init(Platform platform) { public void init(Platform platform) {
if (sInit){
Debuger.log("FlutterBoost is alread inited. Do not init twice");
return;
}
mPlatform = platform; mPlatform = platform;
mManager = new FlutterViewContainerManager(); mManager = new FlutterViewContainerManager();
...@@ -147,7 +153,7 @@ public class FlutterBoost { ...@@ -147,7 +153,7 @@ public class FlutterBoost {
doInitialFlutter(); doInitialFlutter();
} }
sInit = true;
} }
......
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