2011-05-16 77 views

回答

1

要啓動服務:

startService(new Intent(ThisActivity.this, YourService.class)); 

要停止服務:

stopService(new Intent(ThisActivity.this, YourService.class)); 

他們可以從自己的活動範圍內的任何地方調用。

0

沒有必要在正常執行中停止服務。如果需要的話,操作系統會爲你做到這一點。

如果你的服務已經啓動了任何後臺線程,那麼你當然應該停止這些線程。但是,這是以普通的Java方式完成的。

您應該閱讀Multitasking the Android Way

相關問題