开发者

Stop service belonging to another application on Android

开发者 https://www.devze.com 2023-04-02 03:08 出处:网络
How to stop service belonging to another application on Android? Service is started with START_STICKY so if I kill it\'s process it gets restarted afte开发者_如何学运维r few seconds.

How to stop service belonging to another application on Android? Service is started with START_STICKY so if I kill it's process it gets restarted afte开发者_如何学运维r few seconds. Any ideas (incl. those that needs root access) are welcome.


Only one way I found it stop service all time when it come back. You can check per few seconds list of running services ( ActivityManager.getRunningServices(int) ) and kill the service you want to kill every time when it found there.


It is possible to force stop a package until it is explicitly started again by another package (e.g. opened from launcher). This can be done by running the following command as root:

am force-stop package_name_to_stop
0

精彩评论

暂无评论...
验证码 换一张
取 消