简体   繁体   中英

How to Prevent other apps from stopping background service of my app?

我正在尝试制作一个具有后台服务功能的应用程序,但是我需要它能够连续运行直到卸载该应用程序。我如何使用服务来实现它。任何人都可以帮帮我。

You can't do these kind of assumptions on Android. Your app and related service might be killed for whatever. You can't guarantee that.

Read the section on "Creating a started Service" here in Services

Once a service is created, it will continue to run until it stops itself, or is stopped by the system. Why do you need it to run forever?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM