Nguyễn Ngọc Huỳnh
New member
How can I tell if Android background service is running?
Answer
How can I check whether the Service is running in the Background or not?
Answer
How can I check whether the Service is running in the Background or not?
- private boolean isMyServiceRunning() {
- ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
- for (RunningServiceInfo service : manager. getRunningServices(Integer. …
- if (YourService. class. …
- return true;
- }
- }
- return false;