/**
   * 装载插件的Activity
   *
   * @param plugin
   */
  private void fillPluginActivity(LActivityPlugin plugin) {
    try {
      String top = plugin.getTopActivityName();
      if (top == null) {
        top = plugin.from().pluginPkgInfo.activities[0].name;
        plugin.setTopActivityName(top);
      }
      Activity myPlugin =
          (Activity)
              plugin.from().pluginLoader.loadClass(plugin.getTopActivityName()).newInstance();
      plugin.setCurrentPluginActivity(myPlugin);

    } catch (Exception e) {
      throw new LaunchPluginException(e.getMessage());
    }
  }
  private void fillPluginTheme(LActivityPlugin plugin) {

    Theme pluginTheme = plugin.from().pluginRes.newTheme();
    pluginTheme.setTo(super.getTheme());
    plugin.setTheme(pluginTheme);

    PackageInfo packageInfo = plugin.from().pluginPkgInfo;
    String mClass = plugin.getTopActivityName();

    Log.i(
        TAG,
        "Before fill Plugin 's Theme,We check the plugin:info = "
            + packageInfo
            + "topActivityName = "
            + mClass);

    int defaultTheme = packageInfo.applicationInfo.theme;
    ActivityInfo curActivityInfo = null;
    for (ActivityInfo a : packageInfo.activities) {
      if (a.name.equals(mClass)) {
        curActivityInfo = a;
        if (a.theme != 0) {
          defaultTheme = a.theme;
        } else if (defaultTheme != 0) {
          // ignore
        } else {
          // 支持不同系统的默认Theme
          if (Build.VERSION.SDK_INT >= 14) {
            defaultTheme = android.R.style.Theme_DeviceDefault;
          } else {
            defaultTheme = android.R.style.Theme;
          }
        }
        break;
      }
    }

    pluginTheme.applyStyle(defaultTheme, true);

    setTheme(defaultTheme);
    if (curActivityInfo != null) {
      getWindow().setSoftInputMode(curActivityInfo.softInputMode);
    }

    if (LPluginConfig.usePluginTitle) {
      CharSequence title = null;
      try {
        title = LPluginTool.getAppName(this, plugin.getPluginPath());
      } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
      }
      if (title != null) setTitle(title);
    }
  }