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 2019/06/02 02:35:34 UTC

[GitHub] [incubator-weex] Kingatnuaa0528 commented on issue #2505: Weex automated testing problem

Kingatnuaa0528 commented on issue #2505:  Weex automated testing problem
URL: https://github.com/apache/incubator-weex/issues/2505#issuecomment-497993340
 
 
   - Answer1、2: collectIdTask代码如下:
   
   `class collectIdTask extends AsyncTask<Integer, Integer, String> {
               @Override
               protected void onPreExecute() {
                   super.onPreExecute();
               }
               @Override
               protected String doInBackground(Integer... params) {
                   try {
                       collectIDMap();
                       Thread.sleep(1000);
                   }catch (Exception e) {}
                   return "执行完毕";
               }
               @Override
               protected void onProgressUpdate(Integer... progress) {
                   super.onProgressUpdate(progress);
               }
               @Override
               protected void onPostExecute(String result) {
                   mWXHandler.sendEmptyMessage(1);
                   //Log.d("main", "== sendMessage ==");
                   super.onPostExecute(result);
               }
           }`
   
   - Answer3: R.id.container_test_id 是在Activity的根结点上增加的一个FrameLayout,用于存储当前页面所有testId与nativeId的映射关系
   
   - Answer4: mIDMap是一个全局对象,用于存储Activity中testId和nativeId的映射关系,会在每次发现新的testId时将最新的映射关系写到container_test_id的ContentDescription中。代码如下:
   
   `container.setContentDescription(JSON.toJSONString(mIDMap));`
   ------------------------------------
   下周会在blog中提供demo来展示如何run起来的

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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