You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/17 08:25:48 UTC

[35/50] incubator-weex git commit: * [android] if jsf not initialed, use weex to load page may fail and report exception in order to aovid wait exception, report creat instance failed directly and initFramework async

 * [android] if jsf not initialed, use weex to load page may fail and report exception
   in order to aovid wait exception, report creat instance failed directly and initFramework async


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/681e18b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/681e18b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/681e18b0

Branch: refs/heads/release-0.16
Commit: 681e18b014c16f6c679d40432b02eb99cfa437bc
Parents: e617eba
Author: yuhun-alibaba <to...@gmail.com>
Authored: Wed Oct 11 22:41:33 2017 +0800
Committer: gurisxie <27...@qq.com>
Committed: Mon Oct 16 10:58:56 2017 +0800

----------------------------------------------------------------------
 .../java/com/taobao/weex/bridge/WXBridgeManager.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/681e18b0/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 07f2381..70dfc90 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -1377,6 +1377,19 @@ public class WXBridgeManager implements Callback,BactchExecutor {
       instance.onRenderError(WXRenderErrorCode.WX_CREATE_INSTANCE_ERROR, "createInstance fail!");
       return;
     }
+
+    // 如果没有初始化尽快返回Exception,并且异步初始化
+    if (!isJSFrameworkInit()) {
+      instance.onRenderError(WXRenderErrorCode.WX_CREATE_INSTANCE_ERROR, "createInstance fail!");
+      post(new Runnable() {
+        @Override
+        public void run() {
+          initFramework("");
+        }
+      }, instanceId);
+      return;
+    }
+
     WXModuleManager.createDomModule(instance);
     post(new Runnable() {
       @Override