简单系统的运行的服务
public class Main extends Activity {
?private static String APP_TAG = "tag";
?@Override
?public void onCreate(Bundle savedInstanceState) {
??super.onCreate(savedInstanceState);
??setContentView(R.layout.main);
??ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
??List<ActivityManager.RunningServiceInfo> runningServices = activityManager.getRunningServices(50);
??for (int i = 0; i < runningServices.size(); i++) {
???ActivityManager.RunningServiceInfo runningServiceInfo = runningServices.get(i);
???Log.i(APP_TAG, "Process " + runningServiceInfo.process + " with component " + runningServiceInfo.service.getClassName());
??}
?}
}