创建service
重载函数,在启动服务之后启动
@Override public int onStartCommand(Intent intent, int flags, int startId) { return super.onStartCommand(intent, flags, startId); }开始一个服务
startService(new Intent(MainActivity.this,MyService.class));
创建service
重载函数,在启动服务之后启动
@Override public int onStartCommand(Intent intent, int flags, int startId) { return super.onStartCommand(intent, flags, startId); }开始一个服务
startService(new Intent(MainActivity.this,MyService.class));