나는 사용하여 서비스를 시작합니다Android : BIND_AUTO_CREATE 옵션으로 bindService()가 시작한 서비스를 중지하는 방법?
private ServiceConnection _serviceConnection = new ServiceConnection() {...}
bindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);
내가 '다시 시작'서비스에합니다. 나는 다음 bindService를 (호출 할 때까지) 나는 죽지 않는 서비스를 발견
unbindService(_serviceConnection);
// Do some initialization on service
bindService(new Intent(this, MainService.class), _serviceConnection, Context.BIND_AUTO_CREATE);
(들의 OnDestroy가 실행되지 않습니다); I에 의해 그렇게 (나는 그렇게 할 이유가 주장하지 말자) 그래서 onDestroy() 구현에 의해 수행 된 일부 정적 초기화가 해제되었습니다.
질문 : unbindService()가 서비스를 중지 (onDestory() 실행), 으로 초기화하여 bindService()를 다시 실행할 수 있도록하려면 어떻게해야합니까?