使用Service的stopSelf()方法来停止服务

   使用Service的stopSelf()方法来停止服务,要注意这是一个父类的方法,调用了这个方法之后,服务停止的时间不

确定,后面的代码还是会执行,并且onDestroy()方法也会执行,下次重新启动服务的时候,先调用onCreate(),然后再调用onStart()方法。

原文地址:https://www.cnblogs.com/liulaolaiu/p/11744672.html