Пример #1
0
 public void onTerminate() {
   super.onTerminate();
   this.unbindService(notificationServiceConnection);
   this.unbindService(moduleServiceConnection);
   shutdownHttpClient();
   EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON).unregister(originalParser);
   EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON).unregister(this);
   EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON).unregister(mdmSubsrcriber);
 }
Пример #2
0
  private void initConfig() {
    initWebUrls();
    EventBus.registerApp(this);
    /** 获取SharedPreferences对象 */
    sharePref = PreferenceManager.getDefaultSharedPreferences(this);
    Boolean b = Preferences.getFirsttime(Application.sharePref);
    // 判断是不是第一次安装应用,

    CubeApplication app = CubeApplication.getInstance(this);
    app.loadApplication();
    this.setCubeApplication(app);
    app.loadLocalModule();
    // 同步前先显示ui
    CubeModuleManager.getInstance().init(CubeApplication.getInstance(this));
    // 注册
    EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON)
        .register(originalParser = new OriginalParser(this));
    EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON).register(this);
    EventBus.getEventBus(TmpConstants.EVENTBUS_COMMON)
        .register(mdmSubsrcriber = new MdmSubsrcriber(this));
    // 开启定位
    new GeoManager(this.getApplicationContext());
  }