From d8acdb989de035f058a89be014b30b360f082853 Mon Sep 17 00:00:00 2001 From: kangxuyao Date: Thu, 17 Feb 2022 17:17:56 +0800 Subject: [PATCH] =?UTF-8?q?closeApplet=E6=8E=A5=E5=8F=A3=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=8F=8AcloseAllApplets=E6=8E=A5=E5=8F=A3=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../finogeeks/mop/api/mop/AppletManageModule.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletManageModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletManageModule.java index 4593530..df67b0e 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletManageModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletManageModule.java @@ -30,7 +30,7 @@ public class AppletManageModule extends BaseApi { @Override public String[] apis() { - return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet", + return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet", "closeApplet", "setActivityTransitionAnim", "sendCustomEvent", "callJS"}; } @@ -56,8 +56,16 @@ public class AppletManageModule extends BaseApi { callback.onSuccess(null); } } else if (event.equals("closeAllApplets")) { - FinAppClient.INSTANCE.getAppletApiManager().finishAllRunningApplets(); + FinAppClient.INSTANCE.getAppletApiManager().closeApplets(); callback.onSuccess(null); + } else if (event.equals("closeApplet")) { + if (param.containsKey("appId") && param.get("appId") instanceof String) { + String appId = (String) param.get("appId"); + FinAppClient.INSTANCE.getAppletApiManager().closeApplet(appId); + callback.onSuccess(null); + } else { + callback.onFail(null); + } } else if (event.equals("clearApplets")) { FinAppClient.INSTANCE.getAppletApiManager().clearApplets(); callback.onSuccess(null);