Service的编写 创建一个类(这里为FirstService)继承android.app.Service,并覆盖以下方法: onBind(Intent intent) Return the communication channel to the service. onCreate() Called by the system when the service is first created. onStartCommand(Intent intent, int flags, int startId) Called by the system every time a client explicitly starts the service by calling startService(Intent), providing the arguments it supplied and a unique integer token representing the start request. onDestroy() Called by the system to notify a Service that it is no longer used and is being removed.