public void startWidget(String[] parm) {
   if (parm.length < 4) {
     return;
   }
   EBrowserWindow curWind = mBrwView.getBrowserWindow();
   if (null == curWind) {
     return;
   }
   String inAppId = parm[0];
   String inAnimiId = parm[1];
   String inForResult = parm[2];
   String inInfo = parm[3];
   String animDuration = null;
   String appKey = null;
   if (parm.length == 5) {
     animDuration = parm[4];
   }
   if (parm.length == 6) {
     appKey = parm[5];
   }
   int animId = EBrowserAnimation.ANIM_ID_NONE;
   long duration = EBrowserAnimation.defaultDuration;
   try {
     if (null != inAnimiId && inAnimiId.length() != 0) {
       animId = Integer.parseInt(inAnimiId);
     }
     if (null != animDuration && animDuration.length() != 0) {
       duration = Long.parseLong(animDuration);
     }
   } catch (Exception e) {;
   }
   try {
     WDataManager widgetData = new WDataManager(mContext);
     // WWidgetData data = widgetData.getWidgetDataByAppId(inAppId,
     // mBrwView.getCurrentWidget());
     // 修改可以子widget可以打开子widget
     WWidgetData data = widgetData.getWidgetDataByAppId(inAppId, mBrwView.getRootWidget());
     if (data == null) {
       showErrorAlert("AppId为 " + inAppId + " 的Widget不存在");
       jsCallback(function_startWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_FAILED);
       return;
     }
     data.m_appkey = appKey;
     EWgtResultInfo info = new EWgtResultInfo(inForResult, inInfo);
     info.setAnimiId(animId);
     info.setDuration(duration);
     if (startWidget(data, info)) {
       jsCallback(function_startWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_SUCCESS);
     } else {
       jsCallback(function_startWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_FAILED);
     }
   } catch (Exception e) {
     e.printStackTrace();
     showErrorAlert("搜索Widget发生异常!请确认Widget是否损坏!");
     jsCallback(function_startWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_FAILED);
   }
 }
 public void removeWidget(String[] parm) {
   if (parm.length < 1) {
     return;
   }
   String inAppId = parm[0];
   WDataManager dm = new WDataManager(mContext);
   String info = dm.removeWgtByAppID(inAppId);
   if (info.equals("0")) {
     jsCallback(function_removeWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_SUCCESS);
   } else {
     jsCallback(function_removeWidget, 0, EUExCallback.F_C_INT, EUExCallback.F_C_FAILED);
   }
 }
    @Override
    public void run() {
      JSONObject obj = new JSONObject();
      try {
        WWidgetData widgetData = mBrwView.getCurrentWidget();
        if (widgetData != null) {
          // if (widgetData.m_appId != null
          // && widgetData.m_appId.length() > 0) {
          WDataManager dataManager = new WDataManager(mContext);
          ReData reData =
              dataManager.ChekeUpdate(
                  mContext, widgetData.m_updateurl, widgetData.m_appId, widgetData.m_ver);
          if (reData == null) {
            obj.put(EUExCallback.F_JK_RESULT, EUExCallback.F_JV_ERROR);
            jsCallback(function_checkUpdate, 0, EUExCallback.F_C_JSON, obj.toString());
            return;
          } else if (!TextUtils.isEmpty(reData.fileUrl)) {
            obj.put(EUExCallback.F_JK_RESULT, EUExCallback.F_JV_UPDATE);
            obj.put(EUExCallback.F_JK_NAME, reData.fileName);
            obj.put(EUExCallback.F_JK_SIZE, reData.fileSize);
            obj.put(EUExCallback.F_JK_URL, reData.fileUrl);
            obj.put(EUExCallback.F_JK_VERSION, reData.version);
          } else {
            obj.put(EUExCallback.F_JK_RESULT, EUExCallback.F_JV_NO_UPDATE);
          }
          jsCallback(function_checkUpdate, 0, EUExCallback.F_C_JSON, obj.toString());

          // } else {
          // obj.put(EUExCallback.F_JK_RESULT,
          // EUExCallback.F_JV_NO_REGIST);
          // jsCallback(function_checkUpdate, 0,
          // EUExCallback.F_C_JSON, obj.toString());
          // }
          return;
        }
        obj.put(EUExCallback.F_JK_RESULT, EUExCallback.F_JV_ERROR);
        jsCallback(function_checkUpdate, 0, EUExCallback.F_C_JSON, obj.toString());
      } catch (Exception e) {
        try {
          obj.put(EUExCallback.F_JK_RESULT, EUExCallback.F_JV_ERROR);
        } catch (JSONException e1) {
        }
        jsCallback(function_checkUpdate, 0, EUExCallback.F_C_JSON, obj.toString());
      }
    }