コード例 #1
0
  CommandHandlerBase(MainService mainService, int cmdType, Object... commands) {
    if (sMainService == null) {
      sMainService = mainService;
      sSettingsMgr = SettingsManager.getSettingsManager(sContext);
      sContext = mainService.getBaseContext();
      Cmd.setContext(sContext);
    }
    mCommandMap = new HashMap<String, Cmd>();
    for (Object o : commands) {
      Cmd c = (Cmd) o;
      mCommandMap.put(c.getName(), c);
    }
    mCmdType = cmdType;
    mAnswerTo = null;

    initializeSubCommands();
  }