一、Service的启动:
相同app内启动service:
Intent intent = new Intent(this, MessengerService.class);
bindService(intent, mServiceConnection,Context.BIND_AUTO_CREATE);
不同app间启动service:
Intent intent = new Intent();
ComponentName componentName = new ComponentName(targetPkg, targetPkg + ".service.MessengerService");
intent.setComponent(componentName);
bindService(intent, mServiceConnection,Context.BIND_AUTO_CREATE);