标签:
private boolean isServiceRunning() { ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if ("com.example.MyService".equals(service.service.getClassName())) { return true; } } return false; }
如何检查后台服务(Android的Service类)是否正在运行?
标签:
原文地址:http://www.cnblogs.com/netcorner/p/4783060.html