示例#1
0
  public void closeApplicationAnywayImpl(final Activity activity, boolean disableService) {
    if (appInitializer.isAppInitializing()) {
      resourceManager.close();
    }
    activity.finish();
    if (getNavigationService() == null) {
      fullExit();
    } else if (disableService) {
      final Intent serviceIntent = new Intent(this, NavigationService.class);
      stopService(serviceIntent);

      new Thread(
              new Runnable() {
                public void run() {
                  // wait until the service has fully stopped
                  while (getNavigationService() != null) {
                    try {
                      Thread.sleep(100);
                    } catch (InterruptedException e) {
                    }
                  }

                  fullExit();
                }
              })
          .start();
    }
  }
示例#2
0
 public List<String> reloadIndexesOnStart(AppInitializer progress, List<String> warnings) {
   close();
   // check we have some assets to copy to sdcard
   warnings.addAll(checkAssets(progress));
   progress.notifyEvent(InitEvents.ASSETS_COPIED);
   reloadIndexes(progress, warnings);
   progress.notifyEvent(InitEvents.MAPS_INITIALIZED);
   return warnings;
 }