How to stop a system service?

◇◆丶佛笑我妖孽 提交于 2019-12-11 09:31:57

问题


I want to know how to stop a system service using my app in android, I'm not talking here about stopping a Service Class that exists inside my app, I'm taking about stopping a System Service like (Bluetooth, Mailing, Alarm, WiFi, .....etc) I tried to make it like the following but nothing stopped:

    stopService(new Intent(Service.BLUETOOTH_SERVICE));

回答1:


I want to know how to stop a system service using my app in android,

In the UI of your app, you ask the user to completely power down their phone. If your app is a system app (i.e., installed on the /system partition, such as a pre-installed app), you may be able to power down the device yourself.

What developers perceive as a "system service" is merely an API to a core OS process. SDK developers do not have control over those processes.



来源:https://stackoverflow.com/questions/26325741/how-to-stop-a-system-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!