Пример #1
0
  private void stopServer() {

    if (server != null) {
      server.shutdown();
      server = null;
      LOG.Log(Module.GUI, "Server stopped.");
    }
  }
  private void _stopServer(boolean sendToBackground) {

    // ******* TO BE REVIEW, this while is not well programmed, needs to be changed and assure
    // server is stopped after all
    while (server != null && !this.isWebviewLoadingPage()) {
      // [MOBPLAT-179] wait to stop server while page is still loading
      LOG.Log(Module.GUI, "App finished loading, server could be stopped");

      server.shutdown();
      server = null;
      LOG.Log(Module.GUI, "Server stopped.");

      if (sendToBackground) {
        this.activityManager.loadUrlIntoWebView(
            "javascript:try{Appverse._toBackground()}catch(e){}");
      }
    }
  }