diff --git a/android/src/main/java/com/jd/jdsdk/JdsdkPlugin.java b/android/src/main/java/com/jd/jdsdk/JdsdkPlugin.java index b922d0a..3ef762f 100644 --- a/android/src/main/java/com/jd/jdsdk/JdsdkPlugin.java +++ b/android/src/main/java/com/jd/jdsdk/JdsdkPlugin.java @@ -17,7 +17,7 @@ import io.flutter.plugin.common.PluginRegistry.Registrar; public class JdsdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware { public static JDHelper mJDHelper; private MethodChannel channel; - + private ActivityPluginBinding binding; @Override public void onAttachedToEngine(FlutterPluginBinding flutterPluginBinding) { // mJDHelper = JDHelper.getInstance(flutterPluginBinding.getApplicationContext()); @@ -56,6 +56,7 @@ public class JdsdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAw @Override public void onAttachedToActivity(ActivityPluginBinding binding) { Log.d("flutter-taoke", "onAttachedToActivity" + binding); + this.binding=binding; mJDHelper = JDHelper.getInstance(binding); }