You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/22 09:08:19 UTC

[GitHub] wangguanquan opened a new issue #1955: renderByUrl注册WXSDKInstance时机太晚,导致无法在通过getSDKInstance()获取

wangguanquan opened a new issue #1955: renderByUrl注册WXSDKInstance时机太晚,导致无法在通过getSDKInstance()获取
URL: https://github.com/apache/incubator-weex/issues/1955
 
 
   RT: Android SDK
   
   ```
   @Override public void onCreate(Bundle savedInstanceState) {
       mWXSDKInstance = new WXSDKInstance(context);
       mWXSDKInstance.registerRenderListener();
       mWXSDKInstance.renderByUrl(xxx);  // render by url
       super.onCreate(savedInstanceState);
   }
   
   @Override public void onResume() {
       WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(mWXSDKInstance.getInstanceId());
       System.out.println(instance); // null
   }
   ```
   
   WXSDKInstance#renderByUrl方法并没有立即注册Instance,而放在onHttpFinish中。这个逻辑有些奇怪,因为WXSDKInstance是用户实例化出来的,但是却不能获取这个实例有点奇怪。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services