Esempio n. 1
0
  @Override
  protected void onPause() {
    super.onPause();

    MonodictApp.getEventBus().unregister(this);

    unbindService(dictionaryServiceConnection);
  }
Esempio n. 2
0
  @Override
  protected void onResume() {
    super.onResume();

    MonodictApp.getEventBus().register(this);

    if (dictionaryServiceConnection == null) {
      dictionaryServiceConnection = new DictionaryServiceConnection();
      dictionaryServiceConnection.setListener(this);
    }

    bindService(
        new Intent(this, DictionaryService.class),
        dictionaryServiceConnection,
        Context.BIND_AUTO_CREATE);
  }