@Override protected void onPause() { super.onPause(); MonodictApp.getEventBus().unregister(this); unbindService(dictionaryServiceConnection); }
@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); }