From a386c548ec2ada4885a4a8d72815004a96ec9904 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Sat, 18 Apr 2020 10:36:30 +0800 Subject: [PATCH] android:fix DoricActivity be called externally --- doric-android/doric/src/main/AndroidManifest.xml | 3 +-- .../java/pub/doric/loader/DoricJSLoaderManager.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/doric-android/doric/src/main/AndroidManifest.xml b/doric-android/doric/src/main/AndroidManifest.xml index f777c8f1..e3ac733e 100644 --- a/doric-android/doric/src/main/AndroidManifest.xml +++ b/doric-android/doric/src/main/AndroidManifest.xml @@ -5,10 +5,9 @@ - - diff --git a/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java b/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java index dc220da6..97b6aa8a 100644 --- a/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java +++ b/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java @@ -16,6 +16,8 @@ package pub.doric.loader; +import android.text.TextUtils; + import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -53,10 +55,12 @@ public class DoricJSLoaderManager { } public AsyncResult loadJSBundle(String source) { - Collection jsLoaders = getJSLoaders(); - for (IDoricJSLoader jsLoader : jsLoaders) { - if (jsLoader.filter(source)) { - return jsLoader.request(source); + if (!TextUtils.isEmpty(source)) { + Collection jsLoaders = getJSLoaders(); + for (IDoricJSLoader jsLoader : jsLoaders) { + if (jsLoader.filter(source)) { + return jsLoader.request(source); + } } } AsyncResult ret = new AsyncResult<>();