我用下面的语句停止下载服务(延伸IntentService)在后台运行:StopService不调用的onDestroy立即
context.stopService(intent);
但这种说法并没有叫服务onDestory()方法立即,需要一段时间来调用onDestroy()方法的服务。
@Override
public void onDestroy() {
Log.d("JSLog", "on destroy called");
super.onDestroy();
}
我应该做的命中stopService()语句之后,应该马上叫的onDestroy()服务的方法。
http://stackoverflow.com/questions/10554465/how-to-stop-service-immediately – Riser