How to judge whether the backend service is enabled in Android
In this article, the editor introduces in detail "how to determine whether the background service is enabled in Android". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to judge whether the background service is enabled in Android" can help you solve your doubts.
Detailed explanation of two methods of Android to judge whether the background service is enabled or not
Recently, when the project is uploaded to the background, a service service has been opened.
But at the beginning of this method, some models do not support: Coolpad does not support. And then changed to the second method of judgment.
/ / public boolean isServiceWork (Context mContext, String serviceName) {/ / boolean isWork = false;// ActivityManager myAM = (ActivityManager) mContext// .getSystemService (Context.ACTIVITY_SERVICE); / / List myList = myAM.getRunningServices (40); / / if (myList.size ()