Android服务停止

Android服务停止,android,service,Android,Service,如果我停止活动中的服务: Intent locationIntent = new Intent(getApplicationContext(), LocationService.class); stopService(locationIntent); 并重写服务的onDestroy方法,这样它就不会调用super.onDestroy() 它还活着吗?不,它不会活着。onDestroy()方法允许您清理服务为其操作分配的任何资源,但它不会影响组件本身的生命周期。请

如果我停止活动中的服务:

Intent locationIntent = new Intent(getApplicationContext(),
            LocationService.class);
    stopService(locationIntent);
并重写服务的onDestroy方法,这样它就不会调用
super.onDestroy()


它还活着吗?

不,它不会活着。
onDestroy()
方法允许您清理
服务为其操作分配的任何资源,但它不会影响组件本身的生命周期。

请尝试一下,自己看看,但如果省略super.onDestroy(),我想会出现编译错误在我看来,这似乎是一个家庭作业问题……不,不是。我正在写一些我之前的人写过的代码。我在代码中的某个地方看到他推荐super.ondestory,现在我正试图找出他为什么这么做。
@Override
public void onDestroy() {
    //super.onDestroy();
}