How can I tell if Android background service is running?

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?
  1. private boolean isMyServiceRunning() {
  2. ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
  3. for (RunningServiceInfo service : manager. getRunningServices(Integer. …
  4. if (YourService. class. …
  5. return true;
  6. }
  7. }
  8. return false;
29 апр. 2014 г.
 

Tìm kiếm

Back
Top