Service是一个应用程序组件
Service没有图形化界面
Service通常用来处理一些耗时比较长的操作
可以使用Service更新ContentProvider,发送Intent以及启动系统的通知等等。
Service不是一个单独的进程,和应用程序运行在同一个进程中
Service不是一个线程
Context.startService();
Context.stopService();
Intent intent = new Inten();
intent.setClass(TestActivity.this, FirstService.class);
startService(intent);
Intent intent = new Inten();
intent.setClass(TestActivity.this, FirstService.class);
stopService(intent);