START_STICKY在retrun中的服务onStartCommand()将自动重新开始,您不需要再次启动它onDestroy()
START_STICKY
onStartCommand()
onDestroy()
@Override public void onDestroy() { // startService(new Intent(this, AppLifeService.class)); super.onDestroy(); }