From 5303b672647612c8374b2e61dfb2cd6170bb54c4 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Fri, 3 Dec 2021 09:14:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:Android=207.0=E5=8F=8A=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=89=88=E6=9C=AC=E8=AE=BE=E5=A4=87=EF=BC=8C?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=AE=A1=E7=90=86=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=97=A0=E6=B3=95=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/finogeeks/mop/api/mop/AppletModule.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java index 18ccd4e..15a7494 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletModule.java @@ -53,14 +53,18 @@ public class AppletModule extends BaseApi { String appId = String.valueOf(param.get("appId")); Integer sequence = (Integer) param.get("sequence"); Map params = (Map) param.get("params"); + // mContext是FlutterActivity, + // 在Android 6.0、7.0系统的部分设备中热启动小程序时,如果context参数用mContext,会出现无法启动小程序的问题 + // 所以这里使用Application Context + Context context = mContext.getApplicationContext(); if (params == null) { if (sequence == null) { - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, appId); } else { - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, appId, sequence, null); } } else { - FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params); + FinAppClient.INSTANCE.getAppletApiManager().startApplet(context, appId, params); } // String apiServer = (String) param.get("apiServer"); // String apiPrefix = (String) param.get("apiPrefix");