Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的服务中,我正在运行一个无限循环,如何从我尝试过的活动中停止这个无限循环,stopService()但它不会杀死服务。我的循环如下...
stopService()
while(i>=1) { i++; }
我的问题是如何停止这个无限循环服务。
尝试使用
stopService(new Intent(ServiceTest.this,ServiceName.class));