Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stop the service of another app in Android?

On my device runs a service in an app (its not my app and I cannot uninstall it and my device is not rooted) that is always draining power. I can stop that service in my devices application settings but is there a way to stop it programatically, so I don't have to do that manually all the time ?

Could maybe something like stopService(...); work ?

Is there maybe a way to change the scheduler to prevent the restarts of the service ?

"W/ActivityManager(178): Scheduling restart of crashed service xxxx in 5000ms
like image 467
HardCoder Avatar asked May 01 '12 23:05

HardCoder


1 Answers

Get the process id of that particular application and then

android.os.Process.killProcess(processIdKillService)

like image 124
Jambaaz Avatar answered Oct 14 '22 14:10

Jambaaz